Declaration element extraction method and device and extraction model generation method and device

Through the automated declaration element extraction method, the extraction model and domain knowledge base are used to solve the problem of frequent manual intervention in the customs declaration process, and achieve efficient and accurate extraction and format conversion of declaration elements.

CN114065751BActive Publication Date: 2025-10-10ALIBABA GROUP HOLDING LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010786699.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-07
Publication Date
2025-10-10
Estimated Expiration
2040-08-07

AI Technical Summary

Technical Problem

During the customs declaration process, declaration units write declaration elements arbitrarily and in flexible formats, which requires a lot of manual intervention, makes it difficult to update the rules, and cannot adapt to diverse declaration formats.

Method used

Through an automated declaration element extraction method, a pre-generated extraction model is used to perform word segmentation, word vectorization, context information extraction and probabilistic classification on the text information of the declared goods. Combined with the domain knowledge base and loss function iterative learning, declaration elements that meet customs declaration requirements are generated.

Benefits of technology

It realizes the automatic extraction of declaration elements, improves the recognition accuracy and robustness, reduces manual input, and adapts to declaration requirements of different formats.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114065751B_ABST
    Figure CN114065751B_ABST
Patent Text Reader

Abstract

The application discloses a declaration element extraction method and device and an extraction model generation method and device, converts a declaration element recognition and extraction task into a labeling task of text information, and then converts the labeling task into a standard format meeting customs declaration requirements, thereby automatically completing extraction of declaration elements, greatly improving recognition accuracy, improving the accuracy of declaration element extraction, and having higher business value and stronger robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to but is not limited to information processing technology, and in particular to a method and device for extracting declaration elements and a method and device for generating extraction models. Background Art

[0002] Declaration elements are the information elements that must be filled in on the customs declaration form when making import or export declarations to the customs.

[0003] During the customs declaration process for imports and exports, declaration entities are often required to provide various documents describing the entity and the commodities being declared. Most declaration entities are unfamiliar with the content and format of these documents, especially since declaration elements for commodities are often haphazardly written and formatted in flexible formats. Furthermore, the sheer number of commodity types and attributes requires significant manual effort to organize into a standardized format.

[0004] In the related technologies, the extraction of declaration elements is mainly completed manually by relying on rules. This requires a lot of manual intervention, and the rules are not easy to update and difficult to adapt to the extraction of declaration elements with flexible formats. Summary of the Invention

[0005] The present application provides a declaration element extraction method and device and an extraction model generation method and device, which can automatically complete the extraction of declaration elements and improve the accuracy of declaration element extraction.

[0006] An embodiment of the present invention provides a method for extracting declaration elements, including:

[0007] Obtain text information of declared goods from customs declaration documents;

[0008] Inputting the text information of the declared commodity into a pre-generated extraction model for processing to obtain a labeling result;

[0009] The marking result is converted into the declaration element of the customs declaration commodity according to the commodity coding information in the marking result.

[0010] In an exemplary embodiment, the method further includes:

[0011] The obtained text information of the declared goods is preprocessed to remove format information.

[0012] In an exemplary embodiment, inputting the text information of the declared commodity into a pre-generated extraction model to obtain a labeling result includes:

[0013] The extraction model performs word segmentation processing on the input text information of the customs declaration commodity to obtain a word sequence;

[0014] mapping the obtained word sequence to a word vector representation through the extraction model;

[0015] extracting context information from the obtained word vector through a neural network of the extraction model;

[0016] processing each of the extracted context information through a forward network and an output layer of the extraction model to obtain a probability of a category to which the context information belongs;

[0017] selecting a category with the largest probability as label information of the context information;

[0018] a corresponding relationship group composed of different label information and corresponding context information is the labeling result.

[0019] In an exemplary instance, the context information belonging to the same category includes two or more, and the method further includes:

[0020] concatenating the context information belonging to the same category.

[0021] In an exemplary instance, the category is constructed through a domain knowledge base.

[0022] In an exemplary instance, the method further includes:

[0023] calculating an error according to the obtained probability and the labeling result through a loss function;

[0024] updating network parameters of the extraction model through a back propagation algorithm according to the calculated error, so as to iteratively learn the extraction model.

[0025] In an exemplary instance, the converting the labeling result into the declaration element of the customs declaration commodity according to the commodity code information in the labeling result includes:

[0026] cleaning the obtained labeling result;

[0027] converting the cleaned labeling result into the declaration element in a format meeting customs declaration requirements according to the commodity code.

[0028] In an exemplary instance, the method further includes:

[0029] performing word segmentation processing on the text information sample to obtain a word sequence sample;

[0030] labeling the word sequence sample to obtain a corresponding relationship between the word sequence sample and the labeling result;

[0031] The word sequence sample is input into the preset mathematical model, and the labeled result corresponding to the word sequence sample is output from the preset mathematical model, so as to train the preset mathematical model to obtain the extraction model.

[0032] In an example, before the text information sample is segmented to obtain the word sequence sample, the method further includes:

[0033] The text information of the customs declaration commodity is obtained from the customs declaration file sample, and the obtained text information of the customs declaration commodity is preprocessed to obtain the text information sample.

[0034] The application further provides a computer readable storage medium storing computer executable instructions for executing the declaration element extraction method.

[0035] The application further provides a device for implementing declaration element extraction, comprising a memory and a processor, wherein the memory stores instructions executable by the processor, for executing the steps of the declaration element extraction method of any one of the above 9.

[0036] The application further provides a declaration element extraction device, comprising an acquisition module, an extraction module, and a conversion module, wherein

[0037] The acquisition module is configured to obtain text information of a customs declaration commodity from a customs declaration file.

[0038] The extraction module is configured to input the text information of the customs declaration commodity into a pre-generated extraction model to obtain a labeled result.

[0039] The conversion module is configured to convert the labeled result into declaration elements of the customs declaration commodity according to commodity code information in the labeled result.

[0040] In an example, the method further includes:

[0041] The preprocessing module is configured to preprocess the obtained text information of the customs declaration commodity to remove format information.

[0042] In an example, the method further includes:

[0043] The segmentation module is configured to segment the text information to obtain text information of two or more customs declaration commodities.

[0044] The application further provides an extraction model generation method, comprising:

[0045] The text information sample is segmented to obtain a word sequence sample.

[0046] Label the word sequence samples and obtain the corresponding relationship between the word sequence samples and the labeling results;

[0047] The word sequence samples are used as input of a preset mathematical model, the annotation results corresponding to the word sequence samples are used as output of the preset mathematical model, and the preset mathematical model is trained to obtain the extraction model.

[0048] In an exemplary embodiment, before performing word segmentation processing on the text information sample to obtain the word sequence sample, the method further includes:

[0049] The text information of the declared commodity is obtained from the customs declaration document sample, and the obtained text information of the declared commodity is preprocessed to obtain the text information sample.

[0050] In an exemplary embodiment, the mathematical module includes: a bidirectional long short-term memory network LSTM+conditional random field CRF model.

[0051] The present application further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute any of the above extraction model generation methods.

[0052] The present application also provides a device for implementing declaration element extraction, including a memory and a processor, wherein the memory stores the following instructions that can be executed by the processor: steps for the extraction model generation method described in any of the above items.

[0053] The present application further provides an extraction model generation device, comprising: a second acquisition module, a labeling module, and a training module; wherein,

[0054] The second acquisition module is configured to perform word segmentation processing on the text information sample to obtain a word sequence sample;

[0055] The tagging module is configured to tag word sequence samples and obtain the corresponding relationship between the word sequence samples and the tagging results;

[0056] The training module is configured to take the word sequence samples as the input of a preset mathematical model, take the annotation results corresponding to the word sequence samples as the output of the preset mathematical model, and train the preset mathematical model to obtain an extraction model.

[0057] In one exemplary embodiment, the present invention further comprises:

[0058] The first acquisition module is configured to acquire text information of the declared commodity from a customs declaration document sample, and pre-process the acquired text information of the declared commodity to obtain the text information sample.

[0059] The declaration element extraction method provided in the embodiment of the present application converts the declaration element identification and extraction task into a text information labeling task, and then converts it into a standard format that meets the customs declaration requirements, automatically completing the extraction of declaration elements, greatly improving the recognition accuracy and the accuracy of declaration element extraction; and it is more robust and has higher business value.

[0060] The extraction model generation method provided in the embodiment of the present application utilizes a domain knowledge base and manually annotated data to construct an extraction model based on sequence annotation, which better utilizes the semantic information of the text, has better generalization for different formats, and improves the extraction performance of the declaration elements while reducing manual input.

[0061] This solution converts the declaration element identification and extraction task into a sequence labeling task, labels the declaration element text, and then easily converts it into a standard format, which can greatly improve the recognition accuracy, is more robust, and has higher business value.

[0062] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purposes and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] The accompanying drawings are used to provide a further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0064] Figure 1 This is a flow chart of the method for extracting declaration elements in the embodiment of the present application;

[0065] Figure 2 This is a schematic diagram of the composition structure of the declaration factor extraction device in the embodiment of the present application;

[0066] Figure 3 Schematic diagram of the process of extracting a model generation method in an embodiment of the present application;

[0067] Figure 4 Schematic diagram of the composition structure of the extraction model generation device in the embodiment of the present application. DETAILED DESCRIPTION

[0068] To make the purpose, technical solutions and advantages of this application more clear, the embodiments of this application will be described in detail below with reference to the accompanying drawings. It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of this application can be combined with each other in any way.

[0069] In a typical configuration of the present application, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0070] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0071] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.

[0072] The steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. Also, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be performed in an order different from that shown here.

[0073] In order to reduce labor costs, the inventors of the present application attempted to automatically obtain the required fields in the customs declaration documents, namely, the declaration elements, through an automatic recognition and extraction process.

[0074] Figure 1 This is a flow chart of the method for extracting application elements in the embodiment of the present application. Figure 1 Shown, including:

[0075] Step 100: Obtain text information of the declared commodity from the customs declaration document.

[0076] In an exemplary embodiment, the customs declaration documents may include but are not limited to different file types such as pictures, PDF files, Word files, Excel files, etc.

[0077] In an exemplary embodiment, step 100 may include parsing the customs declaration document and extracting text information therein. Here, methods such as optical character recognition (OCR) may be used to parse the customs declaration document.

[0078] In the first embodiment, a Word file is parsed as an example, and the text information obtained therein is contained in "" (it should be noted that the quotation marks are only used to specifically mark the parsed text information, and the parsed text information does not include the quotation marks):

[0079]

[0080] The export contract number is: ******, HS: 8516609000

[0081] 1. Specific product descriptions are as follows:

[0082] 1) Product Name: BBQ Plate

[0083] 2) Application: Baking

[0084] 3) Brand: HENDI

[0085] 4) Export preferential treatment: Uncertain

[0086] 5) Heating principle: The principle of using the thermal expansion coefficient to slowly heat up the pot.

[0087] 6) Model: TEPPANYAKI 238608 (XH-4423)

[0088]

[0089] In the first embodiment, the parsed text information shows that only one commodity is included.

[0090] In an exemplary embodiment, if the parsed text information includes more than two commodities, this step may further include:

[0091] The parsed text information is segmented to obtain the text information of each declared commodity. Here, methods such as template matching and a segmentation model based on conditional random fields (CRF) can be used to segment the parsed text information.

[0092] In the second embodiment, a Word file is parsed as an example, and the text information obtained therein includes "" (it should be noted that the quotation marks are only used to specifically mark the parsed text information, and the parsed text information does not include the quotation marks):

[0093]

[0094] The export contract number is: ******, HS: 8516609000

[0095] 1. Specific product descriptions are as follows:

[0096] 1) Product Name: BBQ Plate

[0097] 2) Application: Baking

[0098] 3) Brand: HENDI

[0099] 4) Export preferential treatment: Uncertain

[0100] 5) Heating principle: The principle of using the thermal expansion coefficient to slowly heat up the pot.

[0101] 6) Model: TEPPANYAKI 238608 (XH-4423)

[0102] HS:8516609000

[0103] 2. Specific product descriptions are as follows:

[0104] 1) Product Name: Electric Grill

[0105]

[0106]

[0107] At this point, the parsed text information needs to be segmented to obtain:

[0108] The text information of the first product includes:

[0109]

[0110] HS:8516609000

[0111] 1. Specific product descriptions are as follows:

[0112] 1) Product Name: BBQ Plate

[0113] 2) Application: Baking

[0114] 3) Brand: HENDI

[0115] 4) Export preferential treatment: Uncertain

[0116] 5) Heating principle: The principle of using the thermal expansion coefficient to slowly heat up the pot.

[0117] 6) Model: TEPPANYAKI 238608 (XH-4423)

[0118]

[0119] The text information for the second product includes:

[0120]

[0121] HS:8516609000

[0122] 2. Specific product descriptions are as follows:

[0123] 1) Product Name: Electric Grill

[0124]

[0125]

[0126] Step 102: Input the text information of the declared goods into a pre-generated extraction model for processing to obtain a labeling result.

[0127] In one exemplary embodiment, step 102 may include:

[0128] The extraction model performs word segmentation on the text information of the input customs declaration goods to obtain a word sequence;

[0129] The word sequence obtained is mapped to a word vector through the extraction model to obtain a word vector representation;

[0130] Extract contextual information from the obtained word vectors through the neural network of the extraction model;

[0131] Each extracted context information is processed through the forward network and output layer of the extraction model, such as the Softmax layer, to obtain the probability of the category to which the context information belongs; the category with the highest probability is selected as the label information of the context information;

[0132] The corresponding relationship group consisting of different label information and corresponding context information is the annotation result.

[0133] Taking the pre-processed text information of the first product as an example, after the labeling process of the extraction model, the labeling results shown below are obtained. In this embodiment, key-value pairs are used to represent the corresponding relationship groups consisting of different tag information and corresponding context information, such as the key-value pair information of the first product:

[0134] [(HSCODE:8516609000),(Product Name: Grill Pan),(Application: Baking),(Brand: HENDI),(Export Preferential Status: Unknown),(Heating Principle: Utilizes the thermal expansion coefficient to gradually heat the pan),(Model: TEPPANYAKI 238608 (XH-4423))]

[0135] By comparing the key-value pair information obtained and the text information of the first commodity after preprocessing, it can be seen that: after the extraction model, the non-standard label information in the customs declaration document is unified. For example: in the text information of the first commodity, "HS" is used as the label to identify the commodity code, and after being processed by the extraction model, the standard is unified as "HSCODE"; for another example: in the text information of the first commodity, "product name" is used as the label to identify the commodity name, and after being processed by the extraction model, the standard is unified as "commodity name".

[0136] In an exemplary embodiment, if there are two or more pieces of context information belonging to the same category, then:

[0137] Concatenate context information belonging to the same category. Taking Table 1 as an example, the words in the category "heating principle" include "utilization," "thermal expansion coefficient," "make," "pot," "slowly," "heating up," "of," and "principle." When obtaining a correspondence group consisting of label information and corresponding context information, concatenate the words corresponding to "heating principle" to form a key-value pair such as (heating principle: the principle of slowly heating the pot by utilizing the thermal expansion coefficient).

[0138] In an exemplary embodiment, the present application may further include:

[0139] The error is calculated based on the obtained probability and the labeling result through the loss function;

[0140] According to the calculated error, the extraction model is iteratively learned through a back propagation algorithm to update the network parameters of the extraction model.

[0141] In an exemplary embodiment, before step 102, the following steps may also be included:

[0142] Step 101: pre-process the obtained text information of the declared goods to remove format information.

[0143] The main purpose of this step is to remove the formatting from the parsed text information, such as replacing line breaks, cleaning special symbols, etc., so that a cleaner text can be obtained to meet the input requirements of the extraction model.

[0144] Still taking the first embodiment as an example, after the preprocessing of this step, the text information of the first product includes: "HS: 8516609000 1. Specific product description is as follows: 1) Product name: Grill tray 2) Application: Baking 3) Brand: HENDI 4) Export preferential status: Uncertain 5) Heating principle: Utilizes the thermal expansion coefficient to slowly heat up the pot body. 6) Model: TEPPANYAKI238608 (XH-4423)".

[0145] Step 103: Convert the labeling result into declaration elements of the declared commodity according to the commodity coding information in the labeling result.

[0146] Different commodity categories have their own corresponding declaration elements, that is, there is a corresponding relationship between commodity coding information and declaration elements.

[0147] In an exemplary embodiment, this step may include: cleaning the obtained annotation results such as Key-Value pairs, selecting and merging the Values ​​of repeated Keys, etc.;

[0148] According to the commodity code, i.e. HSCODE, the cleaned Key-Value pairs are converted into declaration elements in a format that meets customs declaration requirements.

[0149] Taking the first product as an example, its labeling information will be converted into the following declaration elements: |Uncertain|Baking|The principle of using the thermal expansion coefficient to slowly heat up the pot|HENDI|TEPPANYAKI 238608(XH-4423).

[0150] In an exemplary embodiment, it may also include: verifying the correctness of the extracted declaration elements through manual means or other means.

[0151] The declaration element extraction method provided in the embodiment of the present application converts the declaration element identification and extraction task into a text information labeling task, and then converts it into a standard format that meets the customs declaration requirements, automatically completing the extraction of declaration elements, greatly improving the recognition accuracy and the accuracy of declaration element extraction; and it is more robust and has higher business value.

[0152] The present application also provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute any of the above-mentioned declaration element extraction methods.

[0153] The present application further provides a device for implementing declaration element extraction, including a memory and a processor, wherein the memory stores the following instructions that can be executed by the processor: used to execute the steps of the declaration element extraction method described in any one of the above items.

[0154] Figure 2 This is a schematic diagram of the composition structure of the declaration element extraction device in the embodiment of this application, as shown in FIG. Figure 2 As shown, it at least includes: an acquisition module, an extraction module, and a conversion module; wherein,

[0155] The acquisition module is configured to obtain text information of the declared goods from the customs declaration document;

[0156] An extraction module configured to input the text information of the declared commodity into a pre-generated extraction model for processing to obtain a labeling result;

[0157] The conversion module is configured to convert the marking result into the declaration elements of the customs declaration commodity according to the commodity coding information in the marking result.

[0158] In an exemplary example, the declaration element extraction device in the embodiment of the present application may further include: a preprocessing module, configured to preprocess the obtained text information of the declared goods to remove format information.

[0159] In an exemplary example, the declaration element extraction device in the embodiment of the present application may also include: a segmentation module, configured to segment the text information obtained by the acquisition module to obtain text information of more than two customs declaration commodities.

[0160] In an exemplary embodiment, the extraction module is specifically configured as follows:

[0161] The extraction model performs word segmentation on the text information of the input customs declaration goods to obtain a word sequence;

[0162] The word sequence obtained is mapped to a word vector through the extraction model to obtain a word vector representation;

[0163] Extract contextual information from the obtained word vectors through the neural network of the extraction model;

[0164] Each extracted context information is processed through the forward network and output layer of the extraction model, such as the Softmax layer, to obtain the probability of the category to which the context information belongs; the category with the highest probability is selected as the label information of the context information;

[0165] The corresponding relationship group consisting of different label information and corresponding context information is the annotation result.

[0166] The declaration element extraction device provided in the embodiment of the present application converts the declaration element identification and extraction task into a text information labeling task, and then converts it into a standard format that meets the customs declaration requirements, automatically completing the extraction of declaration elements, greatly improving the recognition accuracy and the accuracy of declaration element extraction; and it is more robust and has higher business value.

[0167] Figure 3 Schematic diagram of the process of extracting the model generation method in the embodiment of the present application, as shown in FIG. Figure 3 Shown, including:

[0168] Step 301: Perform word segmentation processing on text information samples to obtain word sequence samples.

[0169] Here, we take the text information of the first product as a customs declaration document sample as an example, and the obtained word sequence samples include:

[0170] [HS: 8516609000 1. Specific product description is as follows: 1) Product name: Grill pan 2) Purpose: Baking 3) Brand: HENDI 4) Export preferential treatment: Uncertain 5) Heating principle: Utilizes the thermal expansion coefficient to slowly heat up the pot. 6) Model: TEPPANYAKI 238608 (XH-4423)]

[0171] In an exemplary embodiment, this step may also include:

[0172] Step 300: obtaining text information of the declared commodity from the customs declaration document sample, and preprocessing the obtained text information of the declared commodity to obtain a text information sample.

[0173] In an exemplary embodiment, the customs declaration document sample can come from a pre-established knowledge base, that is, the type of declaration elements in the embodiment of the present application can be constructed through the knowledge base. Due to the particularity of the declaration element text, the declaration element will not have two consecutive entities of the same category. Therefore, the sequence annotation in the embodiment of the present application does not need to use the BIO system, and only requires a category set + other label method. In other words, traditional sequence annotation uses the BIO system to distinguish consecutive entities with different labels. For example, "Bank of China Industrial and Commercial Bank of China" is segmented into [China, Bank, Industrial and Commercial Bank of China, Bank]. Since Bank of China and Industrial and Commercial Bank of China are two entities, when using the BIO system for labeling, the corresponding labels are [B-ORG, I-ORG, B-ORG, I-ORG], where ORG indicates that the entity type is an organization, and B- indicates the beginning of the entity. In this way, it can be distinguished that there are two consecutive entities, the first is Bank of China (B-ORG) (I-ORG), and the second is Industrial and Commercial Bank of China (B-ORG) (I-ORG). In the scenario of customs declaration elements, since the element information is a KV pair, there is no problem of continuous similar entities, which can simplify the labeling system and improve recognition performance.

[0174] In an exemplary embodiment, the specific implementation of step 300 can refer to steps 100 to 101 and will not be repeated here.

[0175] Step 302: Label the word sequence samples to obtain the corresponding relationship between the word sequence samples and the labeling results.

[0176] Here, the text information of the first commodity is still used as a sample of the customs declaration document, and the obtained word sequence sample is taken as an example. After the word sequence sample meets the standards in step 302, the following correspondence between the word sequence sample and the annotation result can be obtained as shown in Table 1:

[0177]

[0178]

[0179]

[0180] Table 1

[0181] In the correspondence shown in Table 1, "O" indicates no category. The labeling result for "8516609000" is HSCODE, the labeling result for "grill pan" is the product name, the labeling result for "baking" is the purpose, the labeling result for "HENDI" is the brand, the labeling result for "uncertain" is the export preferential treatment, the labeling result for "using the thermal expansion coefficient to slowly heat the pot body" is the heating principle, and the labeling result for "TEPPANYAKI 238608 (XH-4423)" is the model number.

[0182] This step can be achieved through manual marking.

[0183] Step 303: Using the word sequence sample as the input of the preset mathematical model, using the annotation result corresponding to the word sequence sample as the output of the preset mathematical model, and training the preset mathematical model to obtain an extraction model.

[0184] In an exemplary embodiment, the preset mathematical model may be a sequence labeling model, which may specifically include but is not limited to: a bidirectional long short-term memory network (LSTM) + CRF model, etc.

[0185] In an exemplary example, taking the word sequence samples obtained through word segmentation, such as the word segmentation obtained in step 302: [HS,:,8516609000,,1.,Specific product description, as follows:,1), Product name,:, Grill pan,2), Purpose,:, Baking,3), Brand,:, HENDI,4), Export preferential situation,:,5), Heating, principle,:, Utilizing the thermal expansion coefficient to make the pot body slowly heat up,6), Model,:, TEPPANYAKI 238608 (XH-4423)] as an example, the obtained word sequence samples are input into a preset mathematical model such as a bidirectional LSTM+CRF model, and the word vector representation of the text is obtained through the word vector layer in the mathematical model, and then a bidirectional LSTM is used to extract context information, and finally a forward network+softmax classification function is used to obtain the probability of each type of declaration element.

[0186] The calculated probability and labeling results are further calculated through the loss function to obtain the error, and the network parameters can be updated through the back propagation algorithm to realize the iterative learning extraction model.

[0187] The extraction model generation method provided in the embodiment of the present application utilizes a domain knowledge base and manually annotated data to construct an extraction model based on sequence annotation, which better utilizes the semantic information of the text, has better generalization for different formats, and improves the extraction performance of the declaration elements while reducing manual input.

[0188] The present application also provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute any of the above extraction model generation methods.

[0189] The present application further provides a device for implementing declaration element extraction, comprising a memory and a processor, wherein the memory stores the following instructions that can be executed by the processor: for executing the steps of any of the extraction model generation methods described above.

[0190] Figure 4 Schematic diagram of the structure of the extraction model generation device in the embodiment of the present application. Figure 4 As shown, it at least includes: a second acquisition module, a labeling module, and a training module; wherein,

[0191] The second acquisition module is configured to perform word segmentation processing on the text information sample to obtain a word sequence sample;

[0192] The tagging module is configured to tag word sequence samples and obtain the corresponding relationship between the word sequence samples and the tagging results;

[0193] The training module is configured to take the word sequence samples as the input of a preset mathematical model, take the annotation results corresponding to the word sequence samples as the output of the preset mathematical model, and train the preset mathematical model to obtain an extraction model.

[0194] In an exemplary embodiment, the extraction model generation device of the present application further includes:

[0195] The first acquisition module is configured to acquire text information of the declared commodity from the customs declaration document sample, and pre-process the acquired text information of the declared commodity to obtain a text information sample.

[0196] The extraction model generation device provided in the embodiment of the present application uses a domain knowledge base and manually annotated data to build an extraction model based on sequence annotation, which better utilizes the semantic information of the text, has better generalization for different formats, and improves the extraction performance of the declaration elements while reducing manual input.

[0197] Although the embodiments disclosed in this application are as described above, the contents described are merely embodiments adopted to facilitate understanding of this application and are not intended to limit this application. Any person skilled in the art to which this application belongs may make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed in this application. However, the scope of patent protection of this application shall still be based on the scope defined by the attached claims.

Claims

1. A method for extracting application elements, comprising: Obtaining text information of the declared commodity from the customs declaration document; wherein, when obtaining text information of two or more declared commodities from the customs declaration document, segmenting the text information using template matching or a segmentation model based on conditional random fields to obtain text information of each declared commodity; Inputting the text information of the declared commodity into a pre-generated extraction model for processing to obtain a labeling result; Converting the marked result into the declaration element of the declared commodity according to the commodity coding information in the marked result; The annotation result is a corresponding relationship group consisting of different tag information and corresponding context information represented by key-value pairs, and the declaration elements are the fields required in the customs declaration documents; The method further includes: performing word segmentation processing on the text information sample to obtain a word sequence sample; marking the word sequence sample to obtain a corresponding relationship between the word sequence sample and the marking result; wherein the word sequence sample is marked by using a category set plus other labels.

2. The method for extracting declaration elements according to claim 1, further comprising: The obtained text information of the declared goods is preprocessed to remove format information.

3. The method for extracting declaration elements according to claim 1, wherein: The step of inputting the text information of the declared commodity into a pre-generated extraction model to obtain a labeling result includes: The extraction model performs word segmentation processing on the input text information of the customs declaration commodity to obtain a word sequence; Perform word vectorization mapping on the obtained word sequence through the extraction model to obtain a word vector representation; Extracting contextual information from the obtained word vectors through the neural network of the extraction model; Processing each extracted context information through the forward network and output layer of the extraction model to obtain the probability of the category to which the context information belongs; Select the category with the highest probability as the label information of the context information; A corresponding relationship group consisting of different tag information and corresponding context information is the annotation result.

4. The method for extracting declaration elements according to claim 3, wherein the context information belonging to the same category includes two or more, and the method further comprises: The context information belonging to the same category is concatenated.

5. The method for extracting declaration elements according to claim 3, wherein: The categories are constructed through a domain knowledge base.

6. The method for extracting declaration elements according to claim 3, further comprising: The error is calculated based on the obtained probability and the labeling result through the loss function; According to the calculated error, the extraction model is iteratively learned through a back propagation algorithm to update the network parameters of the extraction model.

7. The method for extracting declaration elements according to claim 1, wherein: The step of converting the labeling result into the declaration elements of the commodity to be declared for customs based on the commodity coding information in the labeling result includes: Cleaning the obtained annotation results; The cleaned labeling results are converted into the declaration elements in a format that meets customs declaration requirements according to the commodity code.

8. The method for extracting declaration elements according to claim 1, further comprising: The word sequence samples are used as input of a preset mathematical model, the annotation results corresponding to the word sequence samples are used as output of the preset mathematical model, and the preset mathematical model is trained to obtain the extraction model.

9. The method for extracting application elements according to claim 1, before performing word segmentation processing on the text information sample to obtain the word sequence sample, further comprising: The text information of the declared commodity is obtained from the customs declaration document sample, and the obtained text information of the declared commodity is preprocessed to obtain the text information sample.

10. The method for extracting declaration elements according to claim 8, wherein: The preset mathematical model includes: a bidirectional long short-term memory network LSTM+conditional random field CRF model.

11. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the declaration element extraction method described in any one of claims 1 to claim 10.

12. A device for extracting declaration elements, comprising a memory and a processor, wherein: The memory stores the following instructions that can be executed by the processor: used to execute the steps of the declaration element extraction method described in any one of claims 1 to claim 10.

13. A declaration element extraction device, comprising: Acquisition module, extraction module, transformation module; among them, an acquisition module configured to acquire text information of the declared commodity from the customs declaration document; wherein, when acquiring text information of two or more declared commodities from the customs declaration document, the text information is segmented using template matching or a segmentation model based on conditional random fields to obtain text information of each declared commodity; An extraction module configured to input the text information of the declared commodity into a pre-generated extraction model for processing to obtain a labeling result; A conversion module, configured to convert the marking result into the declaration elements of the declared commodity according to the commodity coding information in the marking result; The annotation result is a corresponding relationship group consisting of different tag information and corresponding context information represented by key-value pairs, and the declaration elements are the fields required in the customs declaration documents; Among them, the text information samples are segmented to obtain word sequence samples; the word sequence samples are labeled to obtain the corresponding relationship between the word sequence samples and the labeling results; among them, the word sequence samples are labeled by using a category set plus other labels.

14. The declaration element extraction device according to claim 13, further comprising: The preprocessing module is configured to preprocess the obtained text information of the declared goods to remove format information.

15. The declaration element extraction device according to claim 13, further comprising: The segmentation module is configured to segment the text information to obtain text information of two or more customs declaration commodities.

Citation Information

Patent Citations

  • Entity identification method, device, device and storage medium

    CN109299458A

  • Text processing method and device, electronic equipment and readable storage medium

    CN111046656A