Text classification method and device
Патент · CN B
Полный текст
The application discloses a text classification method and device, and relates to the technical field of machine learning. The method comprises the steps of obtaining a text to be classified, carrying out vectorization processing through a feature mapping layer to obtain vector representation, carrying out self-attention processing through an encoder to obtain input features, determining a target bottom expert network based on the input features through a first routing network to obtain bottom expert features, determining a target top expert network based on the bottom expert features through a second routing network to obtain top expert features, generating output features based on the bottom expert features and the top expert features, and generating probability distribution of the text to be classified corresponding to all preset labels through a classification layer to determine the text types of the text to be classified. Coarse granularity and fine granularity characteristics of texts are extracted through a text classification model of a hierarchical multi-expert collaborative architecture, so that the method is suitable for multi-stage classification scenes, the accuracy of text classification is improved, and the generalization capability of the text classification model is improved.