Classification model training and classification methods, media, equipment and program products
By combining pre-trained factor extraction models and high-reliability service data as context information, the classification model is trained, which solves the problems of poor classification effect and high cost in the existing technology, and achieves better classification effect and cost considerations .
Patent Information
- Application Number
- CN202410708146.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-05-31
AI Technical Summary
The classification model in the prior art has poor classification effect in specific application scenarios, and improving the classification effect requires manual labeling of element categories, resulting in high costs and inability to take into account both classification effect and cost.
By obtaining the pre-trained feature extraction model, extracting classification elements from the first service data, and combining the context information in the second service data, the classification model is trained to reduce manual annotation and improve classification effect.
It is realized that the classification effect is improved without increasing the cost of manual labeling. By using pre-trained factor extraction models and highly reliable service data as context information, the training effect of the classification model is enhanced.
Smart Images

Figure CN118296469B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of Internet technology, and in particular to the training of classification models and classification methods, media, devices and program products. Background Art
[0002] In order to facilitate the management of the target object, the target object is usually divided into specific object categories. The object category is usually associated with the classification elements of at least one element category. Therefore, the classification elements of the target object itself can be divided into element categories, and the classification elements associated with the object category are matched with the classification elements of the corresponding element category, so as to determine the object category to which the target object belongs. The element category division is usually implemented by a classification model. However, the classification models in the related technology are usually general classification models, and the classification effect is poor when classifying for specific application scenarios. If the classification effect is to be improved, the element categories of the classification elements of the specific application scenario need to be manually labeled, which is costly. Therefore, the related technology cannot take into account both the effect and cost of classification. Summary of the invention
[0003] In a first aspect, an embodiment of the present disclosure provides a method for training a classification model, the method comprising: obtaining first service data, wherein the first service data includes a first classification element; extracting the first classification element from the first service data through a pre-trained element extraction model, and determining a first element category of the first classification element; obtaining second service data, wherein the second service data includes a second classification element and a second element category of the second classification element; inputting the first classification element, the second classification element, and the second element category into a classification model, so that the classification model uses the second classification element and the second element category as context information and outputs a predicted element category of the first classification element; training the classification model based on the first element category and the predicted element category, the classification model being used to obtain a first target element category of a first target classification element of a target object, and the first target classification element and the first target element category are used to determine an object category of the target object.
[0004] In a second aspect, an embodiment of the present disclosure provides a classification method, the method comprising: obtaining a first target element category obtained by classifying a first target classification element of a target object by a classification model, the classification model being trained based on the method described in the first aspect; for any one of a plurality of object categories, obtaining a first candidate classification element of at least one element category associated with the object category, and matching the candidate classification element of the at least one element category with the first target classification element of the corresponding first target element category to obtain a first matching result corresponding to the object category; and determining the target object category of the target object from the plurality of object categories based on the first matching results respectively corresponding to the plurality of object categories.
[0005] In a third aspect, an embodiment of the present disclosure provides a tax rate recommendation method, the method comprising: obtaining a target object category of a target object; recommending the tax rate of the target object to a user based on the target object category; wherein the target object category is determined based on the classification method described in any embodiment of the present application.
[0006] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any embodiment of the present disclosure.
[0007] In a fifth aspect, an embodiment of the present disclosure provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any embodiment of the present disclosure when executing the program.
[0008] In a sixth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which implements the method described in any embodiment of the present disclosure when executed by a processor.
[0009] In the embodiment of the present disclosure, the sample data used to train the classification model includes the first classification element and the first element category obtained by the pre-trained element extraction model from the first service data, and the second classification element and the second element category directly obtained from the second service data. On the one hand, the first element category of the first classification element is identified by the element extraction model, and there is no need to manually label the first element category, thereby reducing the cost of manual labeling; on the other hand, the second classification element and the second element category are directly obtained from the service data. Since the service data itself has a high reliability of information, these data can be used as context information to assist the classification model in classifying the classification elements, thereby obtaining a better classification effect. In summary, the embodiment of the present disclosure can take into account both the effect and cost of classification.
[0010] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings herein are incorporated into the specification and constitute a part of the present disclosure. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.
[0012] Figure 1 It is a schematic diagram of the classification system of an embodiment of the present disclosure.
[0013] Figure 2 It is a schematic diagram of the system architecture of an embodiment of the present disclosure.
[0014] Figure 3 It is a flowchart of the training method of the classification model of the embodiment of the present disclosure.
[0015] Figure 4 It is a schematic diagram of the first service data of an embodiment of the present disclosure.
[0016] Figure 5 It is a structural diagram of the classification model of an embodiment of the present disclosure.
[0017] Figure 6 It is a schematic diagram of input data and output data of the classification model of an embodiment of the present disclosure.
[0018] Figure 7 It is a flow chart of the classification method of the embodiment of the present disclosure.
[0019] Figure 8 It is an overall flow chart of an embodiment of the present disclosure.
[0020] Fig.9A Schematic diagram of the first stage classification process of the embodiment of the present disclosure.
[0021] Fig. 9B Schematic diagram of the second stage classification process of the embodiment of the present disclosure.
[0022] Fig.10 It is a schematic diagram of a means for improving classification accuracy according to an embodiment of the present disclosure.
[0023] Fig.11 It is a flowchart of the tax rate recommendation method of an embodiment of the present disclosure.
[0024] Fig.12 is a schematic diagram of a computer device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0026] The terms used in this disclosure are only for the purpose of describing specific embodiments and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items. In addition, the term "at least one" herein means any combination of at least two of any one or more of a plurality of.
[0027] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0028] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present disclosure and to make the above-mentioned purposes, features and advantages of the embodiments of the present disclosure more obvious and understandable, the technical solutions in the embodiments of the present disclosure are further described in detail below in conjunction with the accompanying drawings.
[0029] In order to facilitate the management of target objects, a classification system can be established in advance, and the target objects can be divided into a specific object category in the classification system. The classification system can include multiple object categories, and the above multiple object categories can be organized into a tree structure (called a category tree). Each object category corresponds to a node in the category tree, wherein the object category corresponding to any node in the category tree is a subcategory of the object category corresponding to the parent node of the node in the category tree. Each object category can be associated with a classification element of at least one element category. Each element category represents a feature dimension, such as material, purpose, composition, object name, applicable object, applicable scene and working principle, etc. The classification element is the specific feature value of the feature dimension represented by the element category. For example, the classification elements of the material element category include glass, metal, ceramic, rubber, etc., the classification elements of the purpose element category include image display, timing, communication, cutting, etc., and the classification elements of the applicable object element category include children, women, students, the elderly, etc. The classification elements of other element categories can be determined according to actual conditions and are not listed here one by one.
[0030] Figure 1 A schematic diagram of a classification system of some embodiments is shown. The classification system includes four levels. The first level is the level where the root node L0 is located. The classification element associated with the object category corresponding to the root node L0 is "metal", and the element category of the classification element is "material". The second level is the level where the child nodes L1 and L2 of the root node L0 are located. The classification element associated with the object category corresponding to the node L1 is "tableware", and the classification element associated with the object category corresponding to the node L2 is "kitchen utensils". The element categories of "tableware" and "kitchen utensils" are both "purpose". The third level is the level where the child nodes L3 and L4 of the node L1, and the child nodes L5 and L6 of the node L2 are located. The classification elements associated with the object categories corresponding to the nodes L3, L4, L5 and L6 are "plate", "bowl", "knife" and "scissors" respectively, and their element categories are all object names. The fourth level is the level where the child nodes L7 and L8 of the node L3 are located. The classification elements associated with the object categories corresponding to the nodes L7 and L8 are “family gatherings” and “restaurants, hotels”, respectively, and their element categories are both “applicable occasions”.
[0031] When classifying the target object, the classification elements of the element categories such as material, purpose, object name and applicable occasion of the target object can be obtained, and the classification elements of each element category of the target object are matched with the classification elements in the classification system to determine the target object category of the target object. For example, when the classification elements of the target object include {material: metal; purpose: tableware; object name: plate; applicable occasion: family gathering}, the target object can be classified into the object category corresponding to the node L7.
[0032] Understandably, Figure 1 The classification system shown is only an exemplary description and is not intended to limit the present disclosure. In other examples, the object category corresponding to each node can be associated with classification elements of multiple element categories, and the element categories of classification elements associated with different object categories can be the same or different. Figure 1 The tree-structured classification system shown is applicable to classification systems with other structures as well. The object classification in the present disclosure is also applicable to classification systems with other structures.
[0033] Figure 2 A schematic diagram of the structure of a classification system in some embodiments is shown, and the classification system includes a service platform 102 and a management platform 104. The service platform 102 is used to generate service data of a target object, and the service data includes classification elements of at least one element category of the target object. The target object can be a physical object, such as clothing, jewelry, electronic equipment, food, tools, books, etc., or a digital object, such as video, image, audio, etc. The element categories to which the classification elements of different target objects belong can be the same or different. The management platform 104 can obtain description information corresponding to a plurality of object categories included in the classification system, and the description information corresponding to each object category is used to describe the classification elements of at least one element category associated with the object category. The management platform 104 can also obtain the service data of the target object from the service platform 102, extract the classification elements from the service data, identify the element category of the classification elements, and match the description information corresponding to the plurality of object categories with the classification elements of the identified corresponding element categories, thereby determining the target object category of the target object.
[0034] The extraction of classification elements and the identification of element categories are usually implemented by classification models. However, the classification models in related technologies are usually general classification models, and the classification effect is poor when classifying for specific application scenarios. If the classification effect is to be improved, the element categories of the classification elements of specific application scenarios need to be manually labeled, which is costly. Therefore, related technologies cannot take into account both the effect and cost of classification at the same time.
[0035] Based on this, the embodiment of the present disclosure proposes a training method for a classification model, and two kinds of sample data are used to train the classification model at the same time. One kind of sample data includes the first classification element extracted from the first service data by the pre-trained element extraction model and the first element category obtained by the element extraction model identifying the first classification element, and the other kind of sample data is the second classification element and the second element category directly obtained from the second service data. On the one hand, the first element category of the first classification element is identified by the element extraction model, and there is no need to manually mark the first element category, thereby reducing the manual marking cost; on the other hand, the second classification element and the second element category are directly obtained from the service platform 102. Since the data on the service platform 102 itself has high reliability, these data can be used as context information to assist the classification model in classifying the classification elements, so as to obtain better classification results. In addition, the use of the first classification element and the first element category as sample data also makes up for the situation that the number of the second classification element and the second element category is insufficient, improves the richness of the sample data, and makes the training effect of the classification model better.
[0036] like Figure 3 As shown, the training method of the classification model of the embodiment of the present disclosure includes the following steps:
[0037] Step S10: Acquire first service data, where the first service data includes a first classification element;
[0038] Step S12: extracting a first classification element from the first service data by using a pre-trained element extraction model, and determining a first element category of the extracted first classification element;
[0039] Step S14: Acquire second service data, where the second service data includes a second classification element and a second element category of the second classification element;
[0040] Step S16: inputting the first classification element, the second classification element, and the second element category into the classification model, so that the classification model uses the second classification element and the second element category as context information and outputs a predicted element category of the first classification element;
[0041] Step S18: training a classification model based on the first element category and the prediction element category, the classification model is used to obtain a first target element category of a first target classification element of the target object, and the first target classification element and the first target element category are used to determine the object category of the target object.
[0042] The method of the embodiment of the present disclosure can be Figure 2 The management platform 104 in the system architecture shown in the figure executes the classification model deployed on the management platform 104. The classification model can be deployed on the management platform 104, and the management platform 104 trains the classification model deployed on the platform by executing the above method.
[0043] In step S10, the first service data may be stored on the service platform 102. The service platform 102 may be an e-commerce platform, a video playback platform, a news platform, or other platform for providing services. The first service data is the data of the target object on the service platform 102. For example, when the service platform 102 is an e-commerce platform, the target object is the goods on the e-commerce platform; accordingly, the first service data is the goods data on the e-commerce platform, including at least one of text data (such as title, category data, product parameters, etc.), picture data, video data, and audio data. When the service platform 102 is a video playback platform, the target object is a video on the video playback platform; accordingly, the first service data is the relevant data of the video on the video playback platform, including at least one video frame in the video, the type of the video, the time of listing, the region to which it belongs, and other data. In other examples, the first service data may also be other types of data, which are not listed here one by one.
[0044] The first service data includes a first classification element, wherein the first classification element is not associated with an element category. Taking the service platform 102 as an e-commerce platform as an example, the first service data may include product images and / or product titles on the e-commerce platform. Figure 4 A schematic diagram of a product image and product title of a camera on an e-commerce platform is shown. The product image includes the camera's pixel value (3 million pixels), intercom mode (two-way voice intercom), aperture value (F1.4 aperture) and storage capacity of the memory card (64G memory card). The product title includes the camera's purpose (monitoring home use), control method (remote control by mobile phone), network type (wireless network) and shooting angle (360-degree panoramic view). The classification elements of each of the above element categories are not associated with the corresponding element categories. For example, the purpose classification element is not associated with "monitoring home use" in the form of a key-value pair similar to {purpose: monitoring home use}, but as part of the character string, it constitutes the product title together with other characters in the string.
[0045] In order to determine the first element category of the first classification element, in step S12, the first classification element can be extracted from the first service data by a pre-trained element extraction model, and the first element category of the first classification element can be identified by the element extraction model.
[0046] The feature extraction model can be a model of a general domain, and the feature extraction model can be trained using sample data of any application scenario, and the sample data used to train the feature extraction model and the first service data can be data of different application scenarios. For example, the sample data used to train the feature extraction model includes service data of a news platform and / or service data of a video playback platform, and the first service data is service data of an e-commerce platform. Since the sample data required for training the feature extraction model can come from any application scenario, the difficulty of obtaining the sample data required for training the feature extraction model is reduced, so that sufficient sample data can be obtained to train the feature extraction model, so that the feature extraction model has better performance when extracting classification elements in the general domain and identifying the element categories of classification elements in the general domain.
[0047] The number of feature extraction models can be greater than or equal to 1, and each feature extraction model can extract the first classification element of the specified feature category. When the number of feature extraction models is greater than 1, the first feature categories of the first classification elements extracted by each feature extraction model can be the same or different, and the first classification element includes the union of the classification elements extracted by each feature extraction model. For example, assuming that the number of feature extraction models is 3, the first feature extraction model is used to extract classification elements of the use feature category, the second feature extraction model is used to extract classification elements of the material feature category and the specification feature category, and the third feature extraction model is used to extract classification elements of the object name feature category. The first classification element includes classification elements of the use feature category, classification elements of the material feature category, classification elements of the specification feature category, and classification elements of the object name feature category. By extracting the first classification element jointly by multiple feature extraction models, the diversity and richness of the feature categories of the extracted first classification elements can be improved.
[0048] In some embodiments, if at least two of the multiple element extraction models determine the same first classification element as different element categories, the element categories determined by the at least two element extraction models can be voted to determine the first element category of the first classification element determined by the at least two element extraction models. For example, the element category with the largest number of votes can be determined as the first element category of the first classification element determined by the at least two element extraction models. Assume that the number of element extraction models is 3, and the three element extraction models are respectively recorded as model 1, model 2 and model 3. The first classification elements extracted by the above-mentioned models 1, model 2 and model 3 all include "home use", wherein model 1 identifies the first classification element "home use" as a purpose classification element, and models 2 and 3 identify the first classification element "home use" as an applicable scene classification element. Then, the number of votes obtained by the purpose classification element is 1, and the number of votes obtained by the applicable scene classification element is 2, so that the applicable scene classification element can be determined as the first element category of the first classification element "home use". Further, if the element category with the largest number of votes cannot be obtained, the first element category of the first classification element determined by the at least two element extraction models can be determined by manual selection or other methods. Through the above method, the ambiguity between different element extraction models can be effectively reduced, and the consistency of the recognition result of the first classification element can be improved.
[0049] Since the first classification elements and the first element categories are obtained by the feature extraction model of the general field, which may include classification elements of the element categories not required by the current application scenario, the first classification elements of the specified element category can be filtered out. For example, the classification elements required for the current application scenario include classification elements of the three element categories of purpose, object name, and material, and the classification elements obtained by the feature extraction model include classification elements of the element categories of purpose, composition, object name, material, applicable object, applicable scene, and working principle, then the classification elements of the element categories of composition, applicable object, applicable scene, and working principle can be filtered out.
[0050] Since the first classification element and the first element category are obtained by the element extraction model of the general field, and the element extraction model of the general field does not accurately classify the element categories of the classification elements of the specific field, the first element category of the first classification element may also be adjusted. The above adjustment may include adjusting the first element category of the first classification element from a certain element category to another element category, for example, adjusting the first element category of the first classification element "household use" from the purpose element category to the applicable scenario element category. The above adjustment may also include adjusting the naming method of the first element category of the first classification element, for example, adjusting the first element category "applicable scenario" to "application occasion".
[0051] In some embodiments, since the amount of first service data input into the element extraction model at a time is limited, the first element category of the first classification element included in the above limited first service data is also limited, which is insufficient to cover all the element categories required for the current application scenario. Therefore, multiple batches of first service data can be obtained, and the union of the classification elements extracted by the element extraction model from the multiple batches of first service data is determined as the first classification element, and the first element category of the first classification element is identified by the element extraction model. Since multiple batches of first service data may include classification elements of element categories that are not required for the current application scenario, each time after extracting classification elements from a batch of first service data, the first classification elements of the specified element category can be filtered out from the currently extracted classification elements. Since multiple batches of first service data may have inconsistent data content, each time after extracting classification elements from a batch of first service data, the first element category of the currently extracted first classification element can be adjusted.
[0052] In step S14, the second service data may also be stored on the service platform 102. The second service data includes a second classification element and a second element category of the second classification element. The second element category and the second classification element are respectively stored as a key and a value in the second service data. In some embodiments, the second service data is a table as shown in the following table:
[0053]
[0054] In the above table, the first column is the second factor category, and the second column is the second classification factor associated with each second factor category. For example, "image clarity" is a second factor category, "3 million pixels" is a second classification factor associated with the second factor category "image clarity"; "night vision function" is another second factor category, and "ultra-low light full color" is a second classification factor associated with the second factor category "night vision function".
[0055] In some embodiments, the service platform 102 may pre-establish a category tree of service objects of the platform. The structure of the category tree may be similar to Figure 1 The structure shown is similar, but the object categories corresponding to each node in the category tree can be different Figure 1Example shown. The first service data and the second service data may be service data of a target object of the same object category in the above-mentioned category tree (for example, an object category corresponding to a leaf node of the category tree). In particular, the first service data and the second service data may be service data of the same target object. Since there is a large correlation between the service data of target objects of the same object category, the second classification element and the second element category included in the second service data of the target object may be used to assist the classification model in classifying the first classification element included in the first service data of the target object. It will be understood that the above is merely an exemplary description and is not intended to limit the present disclosure. In other examples, the first service data and the second service data may also be service data of target objects of different subcategories of the same object category, or other conditions may be satisfied between the first service data and the second service data.
[0056] It should be noted that the present disclosure does not limit the execution order of step S10 and step S14 , and step S14 may be executed in parallel with step S10 , or may be executed before or after step S14 .
[0057] In step S16, the first classification element, the second classification element, and the second element category may be input into the classification model, and the classification model may use the second classification element and the second element category as context information to obtain the predicted element category of the first classification element. Although the second classification element is already associated with the second element category and does not need to be classified, since the second classification element and its second element category are directly recorded in the second service data of the service platform 102, and the second service data is generally considered to be accurate and reliable, the second classification element and its second element category in the second service data may be used to enrich the overall information content, thereby assisting the classification model in classification, so as to improve the classification effect of the classification model.
[0058] In some embodiments, first text information can be extracted from the first service data, and the first text information includes a first classification element. The second service data can also be converted into second text information in which a second classification element is associated with a second element category, such as in the form of "second element category: {second classification element}". Then, the second text information is spliced with the first text information to obtain spliced text information, and the spliced text information is input into the classification model. The classification model can output a first element category with the same length dimension as the first classification element. For example, if the classification model extracts 5 first classification elements, the output first element category is also 5.
[0059] In step S18, the classification model may be trained based on the first element category and the predicted element category. Specifically, the classification loss of the classification model may be determined based on the difference between the first element category and the predicted element category, and the classification model may be trained based on the classification loss. The classification loss may be a negative log-likelihood loss. Assume Indicates the first element category, represents the predicted feature category, then the negative log-likelihood loss It can be written as:
[0060]
[0061] Where X is the first classification feature of the input, M is a mask used to ignore certain parts of the first classification feature, Indicates the predicted feature category given X and M With the first element category Same conditional probability.
[0062] Figure 5 A structural schematic diagram of a classification model of some embodiments is shown. The classification model may include a feature extraction submodel and a classification submodel, wherein the feature extraction submodel may adopt a BERT (Bidirectional Encoder Representations from Transformers) model, and the BERT model includes multiple series-connected Transformer encoders. The classification submodel may adopt a CRF (Conditional Random Field) model. The first service data may be segmented to obtain n segmentation results, and then the n segmentation results may be vectorized to obtain n input vectors x1, x2, ..., xn. It is also possible to obtain n second classification elements and their second element categories, and vectorize each second classification element and its second element category to obtain n input vectors p1, p2, ..., pn. Then, the input vectors x1, x2, ..., xn, p1, p2, ..., pn are input into the BERT model. The CLS tag in the figure is used to represent the semantic representation of the entire sequence corresponding to the input vector x1, x2, ..., xn, and the SEP tag is used to separate the input vector x1, x2, ..., xn and the input vector p1, p2, ..., pn. When the BERT model extracts features, it will use the information of the input vector x1, x2, ..., xn and the input vector p1, p2, ..., pn at the same time, but when the CRF model performs classification, it will only classify the input vector x1, x2, ..., xn and obtain the element categories corresponding to the input vectors x1, x2, ..., xn (that is, the first element category mentioned above), which are recorded as C1, C2, ..., Cn.
[0063] The classification model trained in the above manner can be used to obtain a first target element category of a first target classification element of a target object, and the first target classification element and the first target element category can be used to determine an object category of the target object. Figure 6 A schematic diagram of input data and output data of the classification model in some embodiments is shown. In the training stage, three feature extraction models are used, one feature extraction model is used to extract classification elements of the object name feature category, and the feature extraction model can use the XLM-R model; another feature extraction model is used to extract classification elements of the purpose feature category, and the feature extraction model can use the ICBU_NER model; and another feature extraction model is used to extract classification elements of other feature categories (such as material, specification, etc.), and the feature extraction model can use the RaNER model. The first service data can be input into the above three feature extraction models respectively, and the first classification elements of multiple first feature categories such as object name, purpose, material, specification, etc. can be obtained, and the above first classification elements and their first feature categories can be input into the classification model as input data. In addition, the second service data including the second classification element and the second feature category can also be directly input into the classification model. The output data of the classification model includes the predicted feature category of the first classification element. In the inference stage, the feature extraction model can be not used, and only the target service data of the target object can be input into the classification model, so that the classification model extracts the target classification element and its target feature category from the target service data.
[0064] See also Figure 7 The present disclosure also provides a classification method, the method comprising:
[0065] Step S20: obtaining a first target element category obtained by classifying a first target classification element of a target object by a classification model, wherein the classification model is trained based on the method described in any embodiment of the present disclosure;
[0066] Step S22: for any one of the multiple object categories, obtaining a first candidate classification element of at least one element category associated with the object category, and matching the candidate classification element of the at least one element category with a first target classification element of the corresponding first target element category to obtain a first matching result corresponding to the object category;
[0067] Step S24: determining a target object category of a target object from the plurality of object categories according to the first matching results respectively corresponding to the plurality of object categories.
[0068] The classification model used in the embodiments of the present disclosure can be trained based on the training method in the aforementioned embodiments. The specific training method can be found in the previous text and will not be repeated here.
[0069] In step S20, the first target classification element of the target object may be input into the classification model, and the first target classification element may be a classification element in the first target service data of the target object, and the first target service data is not associated with the target element category. The classification model may extract the first target classification element from the first target service data and identify the target element category of the first target classification element. Furthermore, the second target classification element of the target object and its second target element category may be input into the classification model, and the second target classification element and its second target element category may be associated and recorded in the second target service data. The classification model may not need to extract and identify the second target classification element, but may use the second target classification element and its second target element category to assist in the extraction and identification of the first target classification element.
[0070] In step S22, multiple object categories may be obtained, each of which is associated with a first candidate classification element of at least one element category. Figure 1 As an example of the classification system shown, multiple object categories can include Figure 1 The object categories corresponding to nodes L0 to L8 in Figure 1 In the example shown, each object category is associated with a first candidate classification element of an element category. For example, the object category corresponding to node L0 is associated with the first candidate classification element "metal" of the material category, the object category corresponding to node L1 is associated with the first candidate classification element "tableware" of the usage category, and so on. It can be understood that Figure 1 The object category corresponding to any node in can also be associated with the first candidate classification elements of multiple element categories.
[0071] In some embodiments, a mapping relationship between a pre-established classification element and an object category can be obtained, and the first target classification element can be mapped based on the above mapping relationship to obtain multiple object categories. The above mapping relationship can be established by the service platform 102. Since target objects of different object categories often have different classification elements, by pre-establishing a mapping relationship between classification elements and object categories, multiple object categories can be roughly determined based on the classification elements, and then a more accurate target object category can be further determined through subsequent matching processing. In the above manner, the classification scope can be effectively narrowed, and there is no need to match each object category in the classification system, thereby improving the classification efficiency. For example, assuming that the classification system includes two object categories, clothing and food, a mapping relationship between the clothing category and {material: fabric} can be pre-established. When {material: fabric} is included in the first target classification element obtained, it can be roughly determined that the object category to be classified is clothing rather than food.
[0072] In other embodiments, the plurality of object categories may also include each object category in the classification system, and the first candidate classification element associated with each object category in the classification system may be matched with the first target classification element of the corresponding first target element category.
[0073] In some embodiments, a first candidate classification element associated with an object category is associated with multiple element categories, and the multiple element categories have different priorities. In this case, the priorities of multiple element categories can be obtained, and based on the priorities of the multiple element categories, the first candidate classification elements of the multiple element categories are matched with the first target classification elements of the corresponding first target element category in turn. For example, in a specific example, an object category is associated with classification elements of an object name element category and classification elements of a material element category, respectively, and the priority of the object name element category is higher than that of the material element category, then the classification elements of the object name element category can be matched first; if the object name is matched successfully, the classification elements of the material element category can be matched.
[0074] In some embodiments, the first matching result corresponding to a certain object category can be expressed as a classification score. The higher the classification score, the more consistent the classification elements extracted from the target object by the classification model are with the first candidate classification elements associated with the object category, and thus the higher the possibility of classifying the target object into the object category.
[0075] When the classification elements belong to the element categories of materials, uses, applicable occasions, etc., the target object category of the target object can usually be determined more clearly by matching the classification elements of the above element categories. However, when the classification elements belong to the object name element category, due to the high generalization of the object name, the classification elements of the object name element category can often successfully match multiple object categories, making it difficult to accurately determine the target object category. For example, Figure 1 In the illustrated embodiment, the object names of the object categories corresponding to nodes L7 and L8 are both plates. To solve the above problem, the cluster center of the object name of the target object can be obtained, and the object name included in the first candidate classification element of at least one element category is matched with the cluster center.
[0076] For ease of processing, the object name included in the first candidate classification element of at least one element category can be vectorized to obtain a first vector. The cluster center of the object name of the target object can be obtained based on the following method: vectorize the object name included in the first target classification element to obtain a second vector, obtain the second target classification element of the target object that is pre-associated with the object name, vectorize the second target classification element to obtain a third vector, obtain a pre-established category tree, the category tree includes the object name, and vectorize the object name included in the category tree to obtain a fourth vector. The second vector, the third vector and the fourth vector are centralized to obtain a fifth vector. The fifth vector can be regarded as the cluster center of the object name of the target object.
[0077] The object name included in the first target classification element is extracted from the target service data on the service platform 102 by the classification model, and the first target classification element in the target service data is not associated with the object name element category. The number of object names in the target service data can be greater than or equal to 1. For example, if a product title is "soccer training shoes, student-specific shoes", the object names extracted by the classification model include "soccer training shoes" and "shoes". The second target classification element can be obtained from other target service data on the service platform 102. In these target service data, the object name is used as a key and the second target classification element is used as a value. The two form a key-value pair, and the second target classification element can be directly extracted from the key-value pair. The category tree can be pre-established by the service platform 102, and the category tree can include the object name. The second vector, the third vector and the fourth vector are centrally processed, and the average value of the second vector, the third vector and the fourth vector is calculated. By obtaining vectors corresponding to a plurality of data including object names and performing central processing, the influence caused by the generalization of the object name can be neutralized and the accuracy of the matching result can be improved. The calculation method of the fifth vector is as follows:
[0078]
[0079] in, represents the fifth vector, It means to find the average value, represents the i-th object name extracted by the classification model, n is the total number of object names extracted by the classification model, Represents vectorized processing, represents the i-th second target classification element pre-associated with the object name, m represents the total number of second target classification elements pre-associated with the object name, represents the i-th object name included in the category tree, and z represents the total number of object names included in the category tree.
[0080] After obtaining the first vector and the fifth vector, the first candidate classification element of at least one element category can be matched with the first target classification element of the corresponding first target element category based on the similarity between the first vector and the fifth vector. The similarity between the first vector and the fifth vector can be determined based on the normalized dot product between the first vector and the fifth vector. The normalized dot product is calculated as follows:
[0081]
[0082] in, represents the normalized dot product, <> represents the operation of calculating the dot product, Y represents the first vector, and ||·|| represents the norm.
[0083] In step S24, multiple candidate links can be obtained, and any one of the multiple candidate links includes multiple nodes, and the multiple nodes correspond to multiple object categories one by one, and the object category corresponding to the next node on any one of the multiple candidate links is a subcategory of the object category corresponding to the previous node on the candidate link. For any candidate link, the classification scores of the object categories corresponding to the nodes on the candidate link can be determined according to the first matching result of the object categories corresponding to the nodes on the candidate link, and the classification score of the candidate link can be determined based on the classification scores of the object categories corresponding to the nodes on the candidate link. Then, the target link can be determined from the multiple candidate links based on the classification scores of the multiple candidate links, and the object category corresponding to the last node on the target link is determined as the target object category.
[0084] The specific method of determining the link score is as follows: based on the weights corresponding to the nodes on the candidate link, the classification scores of the object categories corresponding to the nodes on the candidate link are weighted to obtain the classification score of the candidate link. Assume that the classification score of the object category corresponding to the kth node on a candidate link is recorded as , the weight corresponding to the i-th node on the candidate link is recorded as , then the classification score sco of the candidate link is recorded as:
[0085]
[0086] Since the accuracy of the classification result is more affected by the object category corresponding to the previous node on the candidate link, a larger weight can be set for the previous node on the candidate link. In some embodiments, the weight corresponding to the jth node on the candidate link is greater than the weight corresponding to the j+1th node on the candidate link, where j is a positive integer. Optionally, the weights of each node form a geometric progression, which is expressed as:
[0087]
[0088] in,
[0089]
[0090]
[0091] Len is the total number of nodes on the candidate link.
[0092] by Figure 1 Taking the classification system shown as an example, the candidate links include: a link composed of object categories corresponding to nodes L0, L1, L3 and L7 (hereinafter referred to as link 1), a link composed of object categories corresponding to nodes L0, L1, L3 and L8 (hereinafter referred to as link 2), a link composed of object categories corresponding to nodes L0, L1 and L4 (hereinafter referred to as link 3), a link composed of object categories corresponding to nodes L0, L2 and L5 (hereinafter referred to as link 4), and a link composed of object categories corresponding to nodes L0, L2 and L6 (hereinafter referred to as link 5). Taking link 1 as an example, the classification score of the object category corresponding to node L0 can be determined according to the first matching result of the object category corresponding to node L0; the classification score of the object category corresponding to node L1 can be determined according to the first matching result of the object category corresponding to node L1; the classification score of the object category corresponding to node L3 can be determined according to the first matching result of the object category corresponding to node L3; the classification score of the object category corresponding to node L7 can be determined according to the first matching result of the object category corresponding to node L7. Then, the classification score of the object category corresponding to node L0, the classification score of the object category corresponding to node L1, the classification score of the object category corresponding to node L3, and the classification score of the object category corresponding to node L7 are weighted to obtain the classification score of link 1.
[0093] In the above manner, the classification scores of link 2, link 3, link 4 and link 5 can be obtained. Assuming that the classification score of link 1 is greater than the classification score of any candidate link among link 2, link 3, link 4 and link 5, the object category corresponding to the last node on link 1 (i.e., node L7) can be determined as the target object category.
[0094] After determining the target object category, multiple subcategories of the target object category may also be obtained, and for any one of the multiple subcategories, a second candidate classification element of at least one element category associated with the subcategory is obtained, and the second candidate classification element of the at least one element category is matched with the first target classification element of the corresponding first target element category to obtain a second matching result corresponding to the subcategory. According to the second matching results corresponding to the multiple subcategories, the target subcategory of the target object is determined from the multiple subcategories.
[0095] This embodiment adopts a two-stage classification. In the first classification stage, the target object category is first determined; in the second classification stage, the target subcategory is determined from each subcategory of the target object category. Figure 1 In the example shown, it is assumed that the target object category is at the level where nodes L1 and L2 are located, and the target subcategory is at the level where nodes L3, L4, L5 and L6 are located. If a single-stage classification is used, the classification scores of the link where nodes L0-node L1-node L3 are located, the link where nodes L0-node L1-node L4 are located, the link where nodes L0-node L2-node L5 are located, and the link where nodes L0-node L2-node L6 are located need to be sorted. During the sorting process, the classification scores of the object categories corresponding to the seven nodes from nodes L0 to L6 need to be determined. When a two-stage classification is used, the classification scores of the link where nodes L0-node L1 are located and the link where nodes L0-node L2 are located are first determined, and the target object category (assuming that it is the object category corresponding to node L1) is determined. In this stage, only the classification scores of nodes L0, L1 and L2 need to be calculated. Then, the target subcategory is determined from the target object category. In this stage, only the classification scores of nodes L3 and L4 need to be calculated. It can be seen that the above process does not need to calculate the classification scores of the object categories corresponding to the nodes L5 and L6, thereby improving the classification efficiency.
[0096] In some embodiments, in order to facilitate the management of various object categories, coding information can be allocated to each object category to represent the object category, and multiple object categories correspond to multiple coding information one by one. Among them, any coding information includes multiple coding segments, each coding segment corresponds to an object category, and the object category represented by the i+1th coding segment is a subcategory of the object category represented by the i-th coding segment. Each coding segment can include one or more bits of code.
[0097] See also Figure 1 , assuming that the first coding segment represents the object category corresponding to node L0, the second coding segment represents the object category corresponding to node L1 or node L2, the third coding segment represents the object category corresponding to node L3, node L4, node L5 or node L6, and the fourth coding segment represents the object category corresponding to node L7 or node L8, and assuming that each coding segment includes one bit of code. If the coding information of the object category corresponding to nodes L0, L1, L3, L5 and L7 is 1, and the coding information of the object category corresponding to nodes L2, L4, L6 and L8 is 0, then the coding information 1111 represents the object category corresponding to node L7, and 110 represents the object category corresponding to node L4.
[0098] The target object category may be the object category represented by the first K coding segments among the multiple coding segments, and the target subcategory may be the object category represented by the first N coding segments among the multiple coding segments, i, K, and N are positive integers, and N is greater than K. Continuing with the previous example, assuming that the value of K is equal to 3 and the value of N is equal to 4, the target object category is the object category corresponding to node L3, node L4, node L5, or node L6, and the target subcategory is the object category corresponding to node L7 or node L8. Assuming that the target object category is the object category corresponding to node L3, and the target subcategory is the object category corresponding to node L8, the encoding information corresponding to the target object category is 111, and the encoding information corresponding to the target subcategory is 1110.
[0099] In some embodiments, if the target object category cannot be determined, the classification elements associated with the target object category that fail to match the first target classification element may be output, and / or the classification elements associated with the target object category that successfully match the first target classification element may be output. For example, assuming that the target object category is associated with the classification elements of the material element category, the object name element category, and the applicable occasion element category, but among the above three classification elements, only the classification elements of the material element category and the object name element category successfully match the first target classification element, while the classification elements of the applicable occasion element category fail to match the first target classification element, then the following list may be output:
[0100]
[0101] If the target object category is the object category corresponding to the Xth node in the candidate link, and the currently successfully matched object category is the object category corresponding to the Yth (Y is less than X)th node in the candidate link, then each node between the Yth node and the Xth node can be obtained, and the classification element associated with each of the above nodes can be determined as the classification element that failed to match the first target classification element. The object categories corresponding to the first Y nodes in the candidate link can also be obtained, and the classification elements associated with the object categories corresponding to the first Y nodes can be determined as the classification elements that successfully matched the first target classification element.
[0102] By outputting successfully matched classification elements and / or unmatched classification elements, users can clearly understand the matching results of each classification element, thereby improving the interpretability of the classification results.
[0103] In some embodiments, feedback information input by a user (such as an operator) may also be obtained, and the feedback information is used to indicate the accuracy of the target object category. The classification model may be fine-tuned based on the feedback information. Specifically, multiple batches of target objects on the service platform may be sampled, wherein the object category of each batch of target objects sampled may be greater than 1, and the target objects of each object category of the same batch may be sampled according to a preset sampling ratio, and the preset sampling ratio may be determined according to the ratio of target objects of the object category in the historical service data of the service platform. For example, the target object may be a commodity, the historical service data may be the historical transaction data of the commodity, and the ratio of the target object in the historical service data may be the number of target objects of the historical transaction. If the number of target objects of an object category in the historical service data is small, sample data including the classification elements and element categories of the target objects of the object category may be generated manually. Then, the object category of the sampled target object is determined by the method of the embodiment of the present disclosure, and compared with the true category of these target objects. If the object category determined for a target object is inaccurate, these target objects are added to the bad sample set, and the classification process of the target object is manually analyzed, such as determining whether the classification elements and feature categories obtained by the feature extraction model are accurate, whether the scoring and selection of candidate links are accurate, and whether the classification elements associated with the object category are accurate. Directed adjustments can be made based on the analysis results. For example, if it is determined that the classification elements and feature categories obtained by the feature extraction model are inaccurate, the classification elements and feature categories obtained by the feature extraction model can be adjusted. A database of judgment conditions can be established in advance, and the classification process of the target object can be manually analyzed based on the judgment conditions in the database. In addition, the judgment conditions in the data block can also be adjusted and modified.
[0104] The following is an example of a classification scheme for a specific application scenario with the help of the attached figure. In the cross-border model (CrossBorder, CB), the transaction and transportation of goods will cross countries and regions. In order to facilitate the supervision of cross-border goods, the Harmonized Commodity Description and Coding System (HS Code) was developed. HSCode is an internationally unified commodity name and coding system developed by the World Customs Organization (WCO). Its main purpose is to facilitate the classification, statistics, supervision and taxation of internationally traded goods. HS Code usually consists of 6 digits, the first two digits represent the chapter, the middle two digits represent the title within the chapter, and the last two digits represent the specific commodity item. Some countries or regions may expand more digits on the basis of the 6-digit HS Code to achieve more detailed commodity classification for domestic tax and trade policies.
[0105] In the above application scenario, the cross-border traded goods are the target objects, the commodity categories are the object categories, the HS Code is the coding information, different HS Codes correspond to different commodity categories, and the chapters, titles and commodity items of the HS Code are different coding segments. The element categories of the classification elements include the name of the commodity (i.e., the object name in the above embodiment), material, purpose, applicable scenario, etc. Each HS Code corresponds to a set of description information, which is used to describe the classification elements associated with the commodity category corresponding to the HS Code.
[0106] Figure 8 An overall flow chart of the classification process is shown.
[0107] First, the product information (such as product title, product attributes, product category, product image, etc.) can be assembled (step S30), and the assembled product information is sent to the pre-trained classification model. The product information can be obtained from the e-commerce platform (i.e., the service platform 102 in the above embodiment) or input by the user.
[0108] The classification model may identify target classification elements and their target element categories from the assembled commodity information (step S32 ).
[0109] Then, based on the target classification elements and target element categories identified by the classification model, an internationally accepted 6-digit pre-classification is performed, that is, the target objects are classified into the target object categories represented by the first 6 digits of the HS Code (step S34 ).
[0110] Then, a specific country pre-classification is performed based on the international 6-digit pre-classification result, that is, the target object is classified into a target sub-category represented by the number of digits (eg, 8 or 10 digits) of the HS Code of a specific country (step S36 ).
[0111] After the pre-classification of a specific country is completed, the classification results may be analyzed and fed back (step S38 ).
[0112] The internationally accepted 6-digit pre-classification process is as follows Fig.9AAs shown. Before pre-classification, the internationally used 6-digit tariff description (i.e., the description information in the aforementioned embodiment) can be automatically or manually disassembled. The tariff description may include annotations for each object category, which are used to list the target objects of the object category. For example, the object category corresponding to the HS Code numbered 711620 refers to alloy crafts of jewelry and gemstones, which are specifically described as follows: 711620-Alloy crafts: including jewelry and gemstone crafts made of alloy as the main material, such as alloy rings, necklaces, bracelets, etc. Among them, "rings", "necklaces", and "bracelets" are annotations. Since the above annotations are often not comprehensive enough, the annotations can be expanded. The expanded annotations include but are not limited to earrings, brooches, bracelets, etc. In addition, the classification elements described in the tariff description can also be expanded. For example, the classification elements described in the tariff description include the name, material and use of the goods, and the applicable population and functions can be expanded to the tariff description.
[0113] During pre-classification, target classification elements and their target element categories (including first target classification elements and first target element categories obtained by the classification model, and associated second target classification elements and second target element categories), as well as expanded classification elements may be input (step S40).
[0114] Then, for the e-commerce scenario, the target classification elements and / or target element categories can be filtered and expanded. For example, the product name (i.e., the object name in the aforementioned embodiment) can be filtered; for another example, the target classification elements can be expanded with synonyms or near-synonyms (step S42) to obtain the filtered and expanded target classification elements and / or target element categories (in step S44).
[0115] In step S46, some special rules may also be obtained. For example, for a product including multiple components, each component has its own material. When classifying, the materials of the multiple components need to be determined in sequence according to a specific priority.
[0116] In step S48, cluster centers of target classification elements (such as product names) may be calculated based on the filtered and expanded target classification elements and / or target element categories, as well as special rules, and the products may be divided into specific candidate links.
[0117] In step S50, the candidate links may be sorted and filtered according to the classification scores of the candidate links, so as to determine the category of the target object.
[0118] The country-specific pre-classification process is as follows Fig. 9BAs shown. Before pre-classification, the tariff description of the 7th digit and thereafter (i.e., the description information in the aforementioned embodiment) can be automatically or manually disassembled, and the category element expansion and classification element expansion can be performed. Among them, the specific method of category element expansion and classification element expansion is similar to the international 6-digit pre-classification process, which will not be repeated here.
[0119] In step S60, the internationally accepted 6-digit pre-classification result, as well as the target classification element and the target element category may be obtained.
[0120] In step S62, some special rules may also be obtained.
[0121] In step S64, cluster center calculation and candidate link division may be performed based on target classification elements, target element categories, and special rules.
[0122] In step S66, the candidate links may be sorted and filtered according to the classification scores of the candidate links, thereby determining the target subcategory.
[0123] In the above embodiment, before pre-classification, the first element category of the first classification element is automatically marked by multiple general element extraction models, thereby training a classification model dedicated to the classification field, and establishing a mapping relationship between the classification element and the object category, so as to improve the recognition accuracy of the classification element of the commodity. At the same time, a classification element library can be established for the classification elements in the tariff description, and the classification elements in the classification element library can be expanded with synonyms, thereby improving the richness of the classification elements and improving the recognition performance of the tariff elements. During pre-classification, the Corom text vector model can be used for vectorization processing, and the GTE clustering algorithm model can be used to calculate the cluster center. At the same time, special rules can be expanded. For example, for jewelry object categories (such as necklaces), the materials of the necklace body and pendants can be limited, and for textile and clothing object categories, the judgment rules for the patterns and materials of textile and clothing can be limited. In addition, according to actual needs, special rules can also be expanded for object categories such as mechanical parts and watch straps, which are not listed one by one here. After pre-classification, a feedback mechanism can also be established. For example, a bad case set can be generated based on inaccurately classified target objects, and work order analysis can be performed automatically or manually by users, and general rules can be abstracted. The accuracy of the classification results can be improved through the above methods. Fig.10 shown.
[0124] See also Fig.11 The present disclosure also provides a tax rate recommendation method, the method comprising:
[0125] Step S70: obtaining a target object category of a target object;
[0126] Step S72: recommending the tax rate of the target object to the user based on the category of the target object;
[0127] The target object category is determined based on the classification method described in any embodiment of the present disclosure.
[0128] In step S70, the target object may be a commodity; accordingly, the target object category is the target commodity category. For example, in an e-commerce scenario, the target object may be a commodity on an e-commerce platform. The above-mentioned e-commerce platform may be a cross-border e-commerce platform or a domestic e-commerce platform. A cross-border e-commerce platform refers to an online shopping and sales platform that provides services to trading entities in different countries or regions, and a domestic e-commerce platform refers to an e-commerce platform that mainly serves consumers and merchants in the same country and conducts online commodity sales, purchases and related services. In addition, the target object may also be a commodity involved in an offline cross-border transaction process, which is not limited in this disclosure.
[0129] Take the cross-border e-commerce platform as an example. On the cross-border e-commerce platform, merchants need to correctly fill in the HS Code of the product when listing the product. The HS Code is used to indicate the category of the product. The HS Code is directly related to the tariff rate table of each country. Different categories of goods have different tax rates. Some goods may enjoy preferential tax rates or exemption from tariffs, while some sensitive or high-value goods may have higher tax rates. Therefore, the correct use of the HS Code is the basis for calculating the import tariff of goods. In addition to obtaining the target object category, the tax rate corresponding to the target object category can also be obtained. The tax rate corresponding to the target object category is used to determine the tariff of the target object. Among them, the correspondence between the target object category and the tax rate can be stored in advance.
[0130] In some embodiments, the number of target object categories obtained may be greater than or equal to 1. In step S72, at least one target object category and the tax rate corresponding to the at least one target object category may be displayed to the user, and the user may select a target object category (for example, a target object category with the lowest tax rate) from the at least one target object category according to the tax rate corresponding to the at least one target object category as the final object category of the target object. Alternatively, the target object with the lowest tax rate may be directly determined from the various target object categories obtained, and the target object with the lowest tax rate and its tax rate may be recommended to the user.
[0131] The method of the embodiment of the present disclosure can accurately determine the target object category of the target object, thereby accurately recommending the tax rate of the target object to the user.
[0132] An embodiment of the present disclosure further provides a computer device, which at least includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any of the above embodiments is implemented.
[0133] Fig.12 A more specific hardware structure diagram of a computer device provided by an embodiment of the present disclosure is shown, and the device may include: a processor 202, a memory 204, an input / output interface 206, a communication interface 208, and a bus 210. The processor 202, the memory 204, the input / output interface 206, and the communication interface 208 are connected to each other through the bus 210 in the device.
[0134] The processor 202 can be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present disclosure. The processor 202 can also include a graphics card, which can be a Nvidia titan X graphics card or a 1080Ti graphics card, etc.
[0135] The memory 204 may be implemented in the form of a read-only memory (ROM), a random access memory (RAM), a static storage device, a dynamic storage device, etc. The memory 204 may store an operating system and other application programs. When the technical solution provided by the embodiment of the present disclosure is implemented by software or firmware, the relevant program code is stored in the memory 204 and is called and executed by the processor 202.
[0136] The input / output interface 206 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0137] The communication interface 208 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0138] The bus 210 comprises a pathway for transmitting information between the various components of the device, such as the processor 202 , the memory 204 , the input / output interface 206 , and the communication interface 208 .
[0139] It should be noted that, although the above device only shows the processor 202, the memory 204, the input / output interface 206, the communication interface 208 and the bus 210, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present disclosure, and does not necessarily include all the components shown in the figure.
[0140] An embodiment of the present disclosure provides a computer program product, including a computer program. When the computer program is executed by a processor, the method described in any embodiment of the present disclosure is implemented.
[0141] The present disclosure also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method described in any of the above embodiments is implemented.
[0142] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. 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 disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape 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 computer device. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0143] Each embodiment in the present disclosure is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely schematic, wherein the modules described as separate components may or may not be physically separated, and the functions of each module can be implemented in the same one or more software and / or hardware when implementing the embodiment of the present disclosure. It is also possible to select some or all of the modules according to actual needs to achieve the purpose of the embodiment. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0144] The above is only a specific implementation of the embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the embodiment of the present disclosure. These improvements and modifications should also be regarded as the protection scope of the embodiment of the present disclosure.
Claims
1. A training method for a classification model, the method comprising: Acquire first service data, wherein the first service data includes a first classification element; extracting the first classification element from the first service data by using a pre-trained element extraction model, and determining a first element category of the first classification element; Acquire second service data, where the second service data includes a second classification element and a second element category of the second classification element; The second element category and the second classification element are respectively used as a key and a value and are associated and stored in the second service data; inputting the first classification element, the second classification element, and the second element category into a classification model, so that the classification model uses the second classification element and the second element category as context information and outputs a predicted element category of the first classification element; Training the classification model based on the first element category and the prediction element category, the classification model is used to obtain a first target element category of a first target classification element of a target object, and the first target classification element and the first target element category are used to determine an object category of the target object; The first service data is data of a target object on a service platform, wherein the service platform is an e-commerce platform, and the target object is a commodity on the e-commerce platform; The first service data is commodity data on the e-commerce platform, including at least one of text data, image data, video data, and audio data, and the first classification element includes at least one of the following: classification elements of a usage element category, classification elements of a material element category, classification elements of a specification element category, and classification elements of an object name element category; The first service data and the second service data are service data of target objects of the same object category in the category tree or service data of target objects of different subcategories of the same object category; The feature extraction model is a general-purpose model, which is trained using sample data from any application scenario, and the classification model is a model dedicated to the classification field; The number of the element extraction models is greater than 1, and the first classification elements include classification elements extracted from the first service data by a plurality of the element extraction models respectively; If at least two of the multiple feature extraction models determine the same first classification feature as different feature categories, vote on the feature categories determined by the at least two feature extraction models to determine the first feature category of the first classification feature extracted by the at least two feature extraction models.
2. The method according to claim 1, before inputting the first classification element, the second classification element and the second element category into a classification model, the method further comprises: Filter out the first classification features of the specified feature category; and / or The first element category of the first classification element is adjusted.
3. A classification method, comprising: Obtaining a first target element category obtained by classifying a first target classification element of a target object by a classification model, wherein the classification model is trained based on the method described in claim 1 or 2; For any one of the plurality of object categories, obtaining a first candidate classification element of at least one element category associated with the object category, and matching the candidate classification element of the at least one element category with a first target classification element of a corresponding first target element category to obtain a first matching result corresponding to the object category; A target object category of the target object is determined from the multiple object categories according to the first matching results respectively corresponding to the multiple object categories.
4. The method according to claim 3, further comprising: Acquire multiple subcategories of the target object category; For any one of the multiple subcategories, obtaining a second candidate classification element of at least one element category associated with the subcategory, and matching the second candidate classification element of the at least one element category with a first target classification element of the corresponding first target element category to obtain a second matching result corresponding to the subcategory; A target subcategory of the target object is determined from the multiple subcategories according to the second matching results respectively corresponding to the multiple subcategories.
5. According to the method of claim 4, the multiple object categories correspond one-to-one to the multiple coding information, any one of the coding information includes multiple coding segments, each coding segment corresponds to an object category, the object category represented by the i+1th coding segment is a subcategory of the object category represented by the i-th coding segment, the target object category is the object category represented by the first K coding segments of the multiple coding segments, the target subcategory is the object category represented by the first N coding segments of the multiple coding segments, i, K and N are positive integers, and N is greater than K.
6. The method according to claim 3, further comprising: If the target object category cannot be determined, the classification elements associated with the target object category that fail to match the first target classification element are output.
7. The method according to claim 3, further comprising: Obtaining a mapping relationship between pre-established classification elements and object categories; The first target classification element is mapped based on the mapping relationship to obtain the multiple object categories.
8. The method according to claim 3, wherein the first candidate classification elements associated with one object category are associated with a plurality of element categories, and the plurality of element categories have different priorities; the first candidate classification elements of the at least one element category are matched with the first target classification elements of the corresponding first target element category, comprising: Obtaining priorities of the multiple element categories; Based on the priorities of the multiple element categories, first candidate classification elements of the multiple element categories are matched with first target classification elements of the corresponding first target element category in sequence.
9. The method according to claim 3, wherein the first candidate classification element of the at least one element category and the first target classification element both include an object name; and the matching of the first candidate classification element of the at least one element category with the first target classification element of the corresponding first target element category comprises: performing vectorization processing on the object name included in the first candidate classification element of the at least one element category to obtain a first vector; performing vectorization processing on the object name included in the first target classification element to obtain a second vector; Acquire a second target classification element of the target object that is pre-associated with the object name, and perform vectorization processing on the second target classification element to obtain a third vector; Acquire a pre-established category tree, wherein the category tree includes object names; perform vectorization processing on the object names included in the category tree to obtain a fourth vector; Centralize the second vector, the third vector, and the fourth vector to obtain a fifth vector; Based on the similarity between the first vector and the fifth vector, the first candidate classification element of the at least one element category is matched with the first target classification element of the corresponding first target element category.
10. The method according to claim 3, wherein determining the target object category of the target object from the multiple object categories according to the first matching results respectively corresponding to the multiple object categories comprises: Acquire multiple candidate links, wherein any one of the multiple candidate links includes multiple nodes, the multiple nodes correspond to multiple object categories one by one, and the object category corresponding to a subsequent node on any one of the multiple candidate links is a subcategory of the object category corresponding to a previous node on the candidate link; For any candidate link, according to the first matching result of the object category corresponding to each node on the candidate link, determine the classification score of the object category corresponding to each node on the candidate link, and determine the classification score of the candidate link based on the classification score of the object category corresponding to each node on the candidate link; Based on the classification scores of the multiple candidate links, a target link is determined from the multiple candidate links, and the object category corresponding to the last node on the target link is determined as the target object category.
11. The method according to claim 10, wherein determining the classification score of the candidate link based on the classification scores of the object categories corresponding to the nodes on the candidate link comprises: Based on the weights corresponding to the nodes on the candidate link, the classification scores of the object categories corresponding to the nodes on the candidate link are weighted to obtain the classification scores of the candidate link; wherein the weight corresponding to the j-th node on the candidate link is greater than the weight corresponding to the j+1-th node on the candidate link, and j is a positive integer.
12. The method according to claim 3, further comprising: Acquire feedback information input by a user, wherein the feedback information is used to indicate the accuracy of the target object category; The classification model is fine-tuned based on the feedback information.
13. A tax rate recommendation method, the method comprising: Get the target object category of the target object; recommending to the user a tax rate of the target object based on the category of the target object; Wherein, the target object category is determined based on the method described in any one of claims 3 to 12.
14. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
15. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 13 when executing the program.
16. A computer program product, comprising a computer program, which implements the method according to any one of claims 1 to 13 when executed by a processor.
Citation Information
Patent Citations
Method and system for improving conversion rate of network advertisements
CN106204085A
Industrial element identification coding method
CN113672230A
Model training, prediction and content understanding method and electronic equipment
CN113780339A
Delaration element extraction method and device and extraction model generation method and device
CN114065751A
Commodity category prediction method and device, equipment and storage medium
CN114529351A
