CN114186059A - Article classification method and device - Google Patents

Article classification method and device Download PDF

Info

Publication number
CN114186059A
CN114186059A CN202111283186.2A CN202111283186A CN114186059A CN 114186059 A CN114186059 A CN 114186059A CN 202111283186 A CN202111283186 A CN 202111283186A CN 114186059 A CN114186059 A CN 114186059A
Authority
CN
China
Prior art keywords
word
neural network
text
network model
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111283186.2A
Other languages
Chinese (zh)
Inventor
向保才
韩杨
崔雨心
杨建柱
陈晶晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dongfeng Motor Corp
Original Assignee
Dongfeng Motor Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dongfeng Motor Corp filed Critical Dongfeng Motor Corp
Priority to CN202111283186.2A priority Critical patent/CN114186059A/en
Publication of CN114186059A publication Critical patent/CN114186059A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/237Lexical tools
    • G06F40/242Dictionaries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Landscapes

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

Abstract

The invention discloses a method and a device for classifying articles, wherein the method comprises the following steps: acquiring an article data set containing at least one article, wherein the article comprises image information and text information; acquiring image characteristics of the image information based on the image information and a preset target convolutional neural network model; acquiring text characteristics of the text information based on the text information and a preset target word vector model and a target text translation model; training a preset initial fully-connected neural network model based on the image characteristics and the text characteristics to obtain a target fully-connected neural network model; and inputting the article data set into a target full-connection neural network model to obtain a classification result. The classification method can comprehensively utilize the image information and the text information in the articles, reduces the limitation caused by utilizing a single information mode, and enables the articles to be classified more accurately.

Description

Article classification method and device
Technical Field
The present application relates to the field of classification methods, and in particular, to a method and an apparatus for classifying articles.
Background
Nowadays, the automobile industry is developed vigorously, and the automobile is used as a transportation tool which is not necessary to be lacked by each family, thereby having great influence on the national economic construction. The article is used as a knowledge carrier and has a profound influence on enterprises and individuals to learn knowledge and understand the development of new things. Under the current situation, with the development of the internet industry, articles and books are increasingly electronic, and a large number of articles contain pictures of related contents. As the automobile industry in the traditional industry, articles aiming at different directions of the automobile are provided with pictures corresponding to the articles. How to scientifically manage and use the articles and simultaneously, the related articles are conveniently and quickly searched and called, and the classification of the articles in the automobile industry, which are mixed with pictures and texts, is particularly important. The mainstream article classification methods are only used for classifying text information. The picture is also of certain importance as another medium of information, and is especially important for articles with many pictures.
Therefore, how to accurately classify the articles by using the information of the pictures and the texts is a technical problem to be solved urgently at the present stage.
Disclosure of Invention
The article classification method and the article classification device can accurately classify the articles by using the information of the pictures and the texts.
The embodiment of the invention provides the following scheme:
in a first aspect, an embodiment of the present invention provides an article classification method, including the following steps:
acquiring an article data set containing at least one article, wherein the article comprises image information and text information;
obtaining image characteristics of the image information based on the image information and a preset target convolutional neural network model;
acquiring text characteristics of the text information based on the text information and a preset target word vector model and a preset target text translation model;
training a preset initial fully-connected neural network model based on the image features and the text features to obtain a target fully-connected neural network model;
and inputting the article data set into the target full-connection neural network model to obtain a classification result.
In an optional embodiment, before obtaining the image feature of the image information based on the image information and a preset target convolutional neural network model, the method further includes:
obtaining an initial convolutional neural network model; the initial convolutional neural network model is a model capable of extracting features of an image;
training the initial convolutional neural network model based on the image information to adjust the number of output types of the initial convolutional neural network model to obtain a target convolutional neural network model; wherein the number of output types matches the number of classifications of the image information.
In an alternative embodiment, the obtaining the initial convolutional neural network model includes:
constructing an original convolutional neural network model; the original convolutional neural network model is an untrained convolutional neural network model;
and training the original convolutional neural network model based on a preset image sample to obtain the initial convolutional neural network model.
In an optional embodiment, before obtaining the text features of the text information based on the text information and a preset target word vector model and a preset target text translation model, the method further includes:
constructing a word dictionary based on the text information; storing words matched with the words in each text message in the word dictionary;
constructing a word sample set based on the text information and the word dictionary;
training and constructing an initial word vector model based on the word sample set to obtain the target word vector model; and the input quantity and the output quantity of the initial word vector model are matched with the length of the dictionary.
In an optional embodiment, the constructing a word dictionary based on the text information includes:
performing word segmentation processing on the text information to obtain a first word set;
carrying out normalization processing on the words in the first word set according to word meanings to obtain a second word set;
determining a dictionary length based on a number of different words in the second set of words; matching index numbers to different words in the second word set respectively;
obtaining the word dictionary based on the dictionary length and the index number.
In an alternative embodiment, said constructing a word sample set based on said text information and said word dictionary comprises:
for each word in the word dictionary, extracting an adjacent word corresponding to the word from the text information;
obtaining a word sample based on the word and the corresponding adjacent words;
and obtaining the word sample set based on the word samples corresponding to all the words in the word dictionary.
In an optional embodiment, before obtaining the text features of the text information based on the text information and a preset target word vector model and a preset target text translation model, the method includes:
obtaining a word vector of each word in the text information based on the text information and the target word vector model;
obtaining the coding characteristics of each word in the text information based on the word vector and the position information of each word and adjacent words;
and training the constructed initial text translation model based on the coding features to obtain a target text translation model.
In a second aspect, an embodiment of the present invention further provides an article classification apparatus, including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring an article data set containing at least one article, and the article comprises image information and text information;
the first obtaining module is used for obtaining the image characteristics of the image information based on the image information and a preset target convolutional neural network model;
the second obtaining module is used for obtaining text characteristics of the text information based on the text information and a preset target word vector model and a preset target text translation model;
a third obtaining module, configured to train a preset initial fully-connected neural network model based on the image features and the text features, and obtain a target fully-connected neural network model;
and the fourth obtaining module is used for inputting the article data set into the target fully-connected neural network model to obtain a classification result.
In an optional embodiment, the sorting apparatus further comprises:
the second acquisition module is used for acquiring an initial convolutional neural network model; the initial convolutional neural network model is a model capable of extracting features of an image;
the adjusting module is used for training the initial convolutional neural network model based on the image information so as to adjust the number of the output types of the initial convolutional neural network model and obtain a target convolutional neural network model; wherein the number of output types matches the number of classifications of the image information.
In an optional embodiment, the second obtaining module includes:
the construction submodule is used for constructing an original convolutional neural network model; the original convolutional neural network model is an untrained convolutional neural network model;
and the first obtaining submodule is used for training the original convolutional neural network model based on a preset image sample to obtain the initial convolutional neural network model.
In an optional embodiment, the classification apparatus further includes:
the first construction module is used for constructing a word dictionary based on the text information; storing words matched with the words in each text message in the word dictionary;
the second construction module is used for constructing a word sample set based on the text information and the word dictionary;
a fifth obtaining module, configured to obtain the target word vector model based on an initial word vector model trained and constructed by the word sample set; and the input quantity and the output quantity of the initial word vector model are matched with the length of the dictionary.
In an alternative embodiment, the first building block comprises:
the second obtaining submodule is used for carrying out word segmentation processing on the text information to obtain a first word set;
the third obtaining submodule is used for carrying out normalization processing on the words of the first word set according to word meanings to obtain a second word set;
a determining submodule, configured to determine a dictionary length based on the number of different words in the second word set; matching index numbers to different words in the second word set respectively;
and the fourth obtaining submodule is used for obtaining the word dictionary based on the dictionary length and the index number.
In an alternative embodiment, the second building block comprises:
the extraction submodule is used for extracting adjacent words corresponding to each word in the word dictionary from the text information;
a fifth obtaining submodule, configured to obtain a word sample based on the word and the corresponding adjacent word;
and the sixth obtaining submodule is used for obtaining the word sample set based on the word samples corresponding to all the words in the word dictionary.
In an alternative embodiment, the sorting apparatus comprises:
a sixth obtaining module, configured to obtain a word vector of each word in the text information based on the text information and the target word vector model;
a seventh obtaining module, configured to obtain, based on the word vector and location information of each word and an adjacent word, a coding feature of each word in the text information;
and the eighth obtaining module is used for training the constructed initial text translation model based on the coding features to obtain a target text translation model.
In a third aspect, an embodiment of the present invention further provides an electronic device, including: a processor and a processor coupled to the processor;
the memory for storing a computer program;
the processor for executing the computer program to carry out the steps of the method of any one of claims 1 to 7.
In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the steps of the method in any one of the first aspect.
Compared with the prior art, the article classification method and the article classification device provided by the invention have the following advantages:
the classification method comprises the steps of obtaining image features of article image information through a target convolution neural network model, obtaining text features of article text information through a target word vector model and a target text translation model, training an initial full-connection neural network model based on the image features and the text features to obtain a target full-connection neural network model, and classifying articles in an article data set through the target full-connection neural network model. The classification method comprises the steps of respectively learning and acquiring image information and text information in an article through a target convolutional neural network model, a target word vector model and a target text translation model with an attention mechanism; based on the respective characteristics of different models, the image information and the text information in the article can be comprehensively utilized, the limitation caused by utilizing a single information mode is reduced, and the article classification is more accurate; meanwhile, machine learning is carried out based on the convolutional neural network, and the accuracy of automatic classification can be further and continuously improved.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present specification, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of an article classification method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a target convolutional neural network model according to an embodiment of the present invention;
FIG. 3 is a block diagram of a target word vector model according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating the use of a target text translation model according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a target fully-connected neural network model according to an embodiment of the present invention;
FIG. 6 is a flowchart of an application to automotive article classification according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an article classification apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments, and all other embodiments obtained by those skilled in the art based on the embodiments of the present invention belong to the scope of protection of the embodiments of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of an article classification method according to an embodiment of the present invention, including the following steps:
s11, an article data set containing at least one article is obtained, wherein the article comprises image information and text information.
Specifically, the article data set may include an article including image information and text information, wherein the length of the article may be a plurality of pages, and the included image information and text information may be diversified. Taking the automobile field as an example, the image information may include pictures of various automobile parts, and the text information may be word descriptions corresponding to various automobile parts. Of course, the article data set may also include a plurality of articles including image information and text information, and the articles may be based on book magazines or web articles in the automobile industry, such as articles disclosed in microblogs. The article data set is acquired and the process proceeds to step S12.
And S12, obtaining the image characteristics of the image information based on the image information and a preset target convolutional neural network model.
Specifically, the target convolutional neural network model may be obtained by transplanting an existing trained model, or may be obtained by training an article in a field to be classified after being built by itself. Referring to fig. 2, the structure of the target convolutional neural network model sequentially includes a convolutional layer, a linear rectifying layer, an active layer, a pooling layer, a full-link layer, and an output layer according to an input-to-output sequence. Those skilled in the art can understand that, in the target convolutional neural network model, convolutional layers are used for extracting local features of pictures, each convolutional layer may be a plurality of layers, each convolutional layer is composed of a plurality of convolutional units, parameters of each convolutional unit are obtained through optimization of a back propagation algorithm, the purpose of convolutional operation is to extract different input features, the first layer of convolutional layer may only extract some low-level features such as edges, lines, angles and other levels, and more layers of networks may iteratively extract more complex features from the low-level features; the linear rectification layer comprises an activation function, and the problems of gradient explosion and gradient disappearance are avoided by using more efficient gradient descent and backward propagation of linear rectification according to a biological principle, and meanwhile, the calculation process can be simplified; the pooling layer is used for cutting the acquired features into a plurality of areas, and the maximum value or the average value of the areas is taken to obtain new features with small dimensionality; the full-connection layer is used for combining all local features into a global feature and calculating the score of each final class of features, and the output layer is used for outputting the calculation result of the full-connection layer. Therefore, the image features can be extracted from the image information through the target convolutional neural network model.
In specific application, before obtaining image features of image information based on the image information and a preset target convolutional neural network model, the method further comprises the following steps:
obtaining an initial convolutional neural network model; the initial convolutional neural network model is a model capable of extracting features of the image; training an initial convolutional neural network model based on the image information to adjust the number of output types of the initial convolutional neural network model to obtain a target convolutional neural network model; wherein the number of output types matches the number of classifications of the image information.
Specifically, the initial convolutional neural network model can be obtained by transplanting the existing model, the characteristics of the image can be extracted, the initial convolutional neural network model can be trained through the image information for being suitable for extracting the image characteristics in the image information, and the initial convolutional neural network model is subjected to hyper-parameter fine adjustment in the training process so as to improve the accuracy of characteristic extraction. In the training process, the type number of the output results needs to be adjusted, so that the output results are matched with the classification number of the image information, and the accuracy of the output results is further ensured.
Of course, the initial convolutional neural network model may be obtained in other ways, and in a specific embodiment, the obtaining of the initial convolutional neural network model includes:
constructing an original convolutional neural network model; the original convolution neural network model is an untrained convolution neural network model; and training an original convolutional neural network model based on a preset image sample to obtain an initial convolutional neural network model.
Specifically, the original convolutional neural network model does not have the capability of extracting features from an image, so that the training needs to be performed through an image sample, the image sample can select a part of pictures in the ImageNet data set, and the training can be directly performed by using the ImageNet data set, so that the original convolutional neural network model can master the capability of extracting features from the pictures to obtain an initial convolutional neural network model, and the training is further performed on the initial convolutional neural network model to obtain a target convolutional neural network model. The image features are obtained by the target convolutional neural network model and the process proceeds to step S13.
S13, obtaining text characteristics of the text information based on the text information and a preset target word vector model and a preset target text translation model.
Specifically, the target word vector model is used for converting text features in the text information into word vectors with certain dimensions, and the target text translation model correspondingly extracts the text features from the text information based on the word vectors. The target word vector model can be a word2vec word vector model, the target text translation model can be a Transformer encoder model, and the output of the target word vector model is combined with the target text translation model, so that text features extracted from text information can be more accurate.
In a specific implementation manner, before obtaining text features of text information based on the text information and a preset target word vector model and a preset target text translation model, the method further includes:
constructing a word dictionary based on the text information; words matched with the words in each text message are stored in the word dictionary; constructing a word sample set based on the text information and the word dictionary; training the constructed initial word vector model based on the word sample set to obtain a target word vector model; the input quantity and the output quantity of the initial word vector model are matched with the length of the dictionary.
Specifically, the word dictionary can be constructed by extracting words or words corresponding to text features from the text information, the length of the words is defined according to the self meaning, and the words stored in the word dictionary can also be words which are thought to be close in the text information so as to match the text features in the text information. The word sample set contains words with different meanings, the initial word vector model is trained through the words in the word sample set, and the hyper-parameter fine tuning processing is carried out on the words, so that the target word vector model can accurately output word vectors. The target word vector model may be a word2vec model, please refer to fig. 3, which is a three-layer neural network, the input and output numbers are the length of the word sample set, and the number of neurons in the hidden layer may be 300, so as to perform better linear division.
In a specific embodiment, constructing a word dictionary based on text information includes:
performing word segmentation processing on the text information to obtain a first word set; carrying out normalization processing on the words in the first word set according to word meanings to obtain a second word set; determining a dictionary length based on the number of different words in the second set of words; different words in the second word set are respectively matched with index numbers; based on the dictionary length and the index number, a word dictionary is obtained.
Specifically, the text information may be a description of a relevant word in an article for the image information, the sentence in the text information is subjected to word segmentation, the sentence is segmented during processing, and a word without an actual meaning is removed, and the word without the actual meaning may be a common suffix, for example, a semantic word such as "already" or "did", so as to obtain the first word set. Because the words with the same actual meaning may exist in the first word set, and the word amount in the word dictionary has redundancy, the normalization processing may be performed according to specific meanings, for example, the first word set includes "happy" and "happy", and the normalization processing may convert the word "happy" into "happy" to obtain a second word set with an accurate word amount. Based on the number of different words in the second word set, the length of the dictionary can be determined, i.e., the larger the number of different words, the longer the length of the dictionary; conversely, the shorter the dictionary length. Further, different words are respectively matched with index numbers, so that the different words have unique index numbers, and the words in the word dictionary can be searched in a digital mode.
In a specific embodiment, constructing a word sample set based on the text information and the word dictionary includes:
aiming at each word in the word dictionary, extracting adjacent words corresponding to the word from the text information; obtaining a word sample based on the word and the corresponding adjacent words; and obtaining a word sample set based on the word samples corresponding to all the words in the word dictionary.
Specifically, each word in the word dictionary may be defined according to a requirement for classification, or may be extracted based on text information, adjacent words in the word dictionary corresponding to the word in the text information may have a certain relevance, and a word sample set is obtained based on word samples corresponding to all the words, so that information in the word sample set can be more accurate. For example, the text information comprises a sentence "i love the invention", the word dictionary comprises "love", adjacent words "i" and "invention" are correspondingly extracted from the text information, the word sample set comprises the corresponding relation between "love" and "i" and "invention", and the initial word vector model constructed by training the word sample set can make the target word vector model more accurate, so that the target word vector model can accurately extract more accurate features from the text information.
In a specific implementation manner, before obtaining text features of the text information based on the text information and a preset target word vector model and a preset target text translation model, the method includes:
obtaining a word vector of each word in the text information based on the text information and the target word vector model; acquiring coding features of each word in the text information based on the word vectors and the position information of each word and adjacent words; and training the constructed initial text translation model based on the coding features to obtain a target text translation model.
Specifically, the initial text translation model may be a Transformer encoder model, and the specific process may refer to fig. 4, where the model includes an attention mechanism, which simulates human attention behavior, so that the initial text translation model can find the most critical word in the article text. The formula of the attention mechanism is as follows:
Figure BDA0003331879320000111
q is a text feature to be extracted from text information, K is all word vectors and can be output through a target word vector model, V is a value of a corresponding word, and the word vectors, namely the code values of the words in the article, can be converted into word vectors through one-hot processing of the words in a word dictionary and through a word2vec model. d _ and k are dimensions of text features and word vectors respectively, the corresponding dimensions can be confirmed through a word2vec model, the number of neurons in a hidden layer in the model is 300, and the features of each word are output of the neurons in the hidden layer of the model, namely the features of each word are 300-dimensional vectors. The method comprises the steps of obtaining position codes by adopting a one-dimensional position coding method for position information of each word and adjacent words, adding the codes of each vector word and the one-dimensional position codes to obtain the coding characteristics of each word in text information, training a constructed initial text translation model through the coding characteristics to improve the attention of the initial text translation model, and carrying out fine tuning processing on the hyper-parameters of the initial text translation model in the training process until the text characteristics of the text information can be accurately obtained to obtain a trained target text translation model. The text features are obtained by the target text translation model, and the process proceeds to S14. In addition, steps S12 and S13 are in parallel, and either of them may be executed first.
And S14, training a preset initial fully-connected neural network model based on the image features and the text features to obtain a target fully-connected neural network model.
Specifically, the image features and the text features are corresponding features, taking an automobile article as an example, the extracted image features are a steering wheel image, and the text corresponding to the text features is also a steering wheel, so as to train the initial fully-connected neural network model, perform the hyper-parameter fine tuning according to the output result of the initial fully-connected neural network model until an accurate result can be output after the image features and the text features are obtained, so as to obtain the target fully-connected neural network model, and then enter step S15.
And S15, inputting the article data set into the target fully-connected neural network model to obtain a classification result.
Specifically, the article data set may include a plurality of articles, and the architecture of the target fully-connected neural network model please refer to fig. 5, which includes an input layer, a hidden layer, and an output layer, where the image features and the text features are extracted, input through the input layer, linearly divided through the hidden layer, and output through the output layer, where the classification results include all kinds and numbers of the articles. It should be noted that after the image features and the text features are input into the target fully-connected neural network model, accurate classification can be automatically performed according to the image features and the text features contained in the article; it is to be understood that the type of the article in the data set may also be not limited, and if the article does not include the text feature corresponding to the image feature, the target fully-connected neural network model may output the result of other classification.
Therefore, by the classification method of the embodiment of the invention, after the corresponding training of each model is completed, the articles to be classified only need to acquire the data source containing the articles, and the articles can be quickly and accurately classified after being put into the article data set, so that the articles in the corresponding field can be quickly and automatically screened.
The following embodiments of the present invention will specifically explain the classification process by applying to automobile article classification, please refer to fig. 6, obtain an automobile industry article data set containing pictures and texts, and separate the picture set and the text set; and (2) building a convolutional neural network (or original convolutional neural network model when not trained), training the convolutional neural network model by using an ImageNet data set until the convolutional neural network model can extract the characteristics in the picture, retraining the picture for the picture in the automobile industry by using the picture set until the convolutional neural network model can extract the characteristics of the picture in the automobile industry so as to obtain a post-convolutional neural network (or target convolutional neural network model when training is finished) after the training is finished, and storing the convolutional neural network.
Meanwhile, a dictionary is created according to the text set, one-hot encoding (one-hot encoding) is carried out on words in the dictionary, a word2vec model is built, the words after the one-hot encoding are used for training, the words in the dictionary are encoded by the model, a Transformer encoder model is built, and the words after the word2vec encoding and a 1D position encoder are used for training the model. And finally, building a full connection layer neural network, extracting the characteristics of the pictures and the texts in the articles by using the convolutional neural network and the Transformer encoder, training the full connection layer neural network by using the extracted characteristics and the corresponding article types, and finally realizing the automatic classification of the automobile articles by using the full connection layer neural network.
Based on the same inventive concept as the classification method, an embodiment of the present invention further provides an article classification apparatus, please refer to fig. 7, including:
a first obtaining module 701, configured to obtain an article data set including at least one article, where the article includes image information and text information;
a first obtaining module 702, configured to obtain an image feature of the image information based on the image information and a preset target convolutional neural network model;
a second obtaining module 703, configured to obtain text features of the text information based on the text information and a preset target word vector model and a preset target text translation model;
a third obtaining module 704, configured to train a preset initial fully-connected neural network model based on the image features and the text features, and obtain a target fully-connected neural network model;
a fourth obtaining module 705, configured to input the article data set into the target fully-connected neural network model, so as to obtain a classification result.
In an optional embodiment, the sorting apparatus further comprises:
the second acquisition module is used for acquiring an initial convolutional neural network model; the initial convolutional neural network model is a model capable of extracting features of an image;
the adjusting module is used for training the initial convolutional neural network model based on the image information so as to adjust the number of the output types of the initial convolutional neural network model and obtain a target convolutional neural network model; wherein the number of output types matches the number of classifications of the image information.
In an optional embodiment, the second obtaining module includes:
the construction submodule is used for constructing an original convolutional neural network model; the original convolutional neural network model is an untrained convolutional neural network model;
and the first obtaining submodule is used for training the original convolutional neural network model based on a preset image sample to obtain the initial convolutional neural network model.
In an optional embodiment, the classification apparatus further includes:
the first construction module is used for constructing a word dictionary based on the text information; storing words matched with the words in each text message in the word dictionary;
the second construction module is used for constructing a word sample set based on the text information and the word dictionary;
a fifth obtaining module, configured to obtain the target word vector model based on an initial word vector model trained and constructed by the word sample set; and the input quantity and the output quantity of the initial word vector model are matched with the length of the dictionary.
In an alternative embodiment, the first building block comprises:
the second obtaining submodule is used for carrying out word segmentation processing on the text information to obtain a first word set;
the third obtaining submodule is used for carrying out normalization processing on the words of the first word set according to word meanings to obtain a second word set;
a determining submodule, configured to determine a dictionary length based on the number of different words in the second word set; matching index numbers to different words in the second word set respectively;
and the fourth obtaining submodule is used for obtaining the word dictionary based on the dictionary length and the index number.
In an alternative embodiment, the second building block comprises:
the extraction submodule is used for extracting adjacent words corresponding to each word in the word dictionary from the text information;
a fifth obtaining submodule, configured to obtain a word sample based on the word and the corresponding adjacent word;
and the sixth obtaining submodule is used for obtaining the word sample set based on the word samples corresponding to all the words in the word dictionary.
In an alternative embodiment, the sorting apparatus comprises:
a sixth obtaining module, configured to obtain a word vector of each word in the text information based on the text information and the target word vector model;
a seventh obtaining module, configured to obtain, based on the word vector and location information of each word and an adjacent word, a coding feature of each word in the text information;
and the eighth obtaining module is used for training the constructed initial text translation model based on the coding features to obtain a target text translation model.
Based on the same inventive concept as the classification method, an embodiment of the present invention further provides an electronic device, including: a processor and a processor coupled to the processor;
the memory for storing a computer program;
the processor is configured to execute the computer program to implement the steps of any of the classification methods.
Based on the same inventive concept as the classification method, embodiments of the present invention also provide a computer-readable storage medium on which a computer program is stored, which, when executed by a processor, implements the steps of any one of the classification methods.
The technical scheme provided by the embodiment of the invention at least has the following technical effects or advantages:
the classification method comprises the steps of respectively learning and acquiring image information and text information in an article through a target convolutional neural network model, a target word vector model and a target text translation model with an attention mechanism; based on the respective characteristics of different models, the image information and the text information in the article can be comprehensively utilized, the limitation caused by utilizing a single information mode is reduced, and the article classification is more accurate; meanwhile, machine learning is carried out based on the convolutional neural network, and the accuracy of automatic classification can be further and continuously improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (modules, systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method for classifying articles, comprising the steps of:
acquiring an article data set containing at least one article, wherein the article comprises image information and text information;
obtaining image characteristics of the image information based on the image information and a preset target convolutional neural network model;
acquiring text characteristics of the text information based on the text information and a preset target word vector model and a preset target text translation model;
training a preset initial fully-connected neural network model based on the image features and the text features to obtain a target fully-connected neural network model;
and inputting the article data set into the target full-connection neural network model to obtain a classification result.
2. The method for classifying articles according to claim 1, wherein before obtaining the image features of the image information based on the image information and a preset target convolutional neural network model, the method further comprises:
obtaining an initial convolutional neural network model; the initial convolutional neural network model is a model capable of extracting features of an image;
training the initial convolutional neural network model based on the image information to adjust the number of output types of the initial convolutional neural network model to obtain a target convolutional neural network model; wherein the number of output types matches the number of classifications of the image information.
3. The method of classifying an article according to claim 2, wherein said obtaining an initial convolutional neural network model comprises:
constructing an original convolutional neural network model; the original convolutional neural network model is an untrained convolutional neural network model;
and training the original convolutional neural network model based on a preset image sample to obtain the initial convolutional neural network model.
4. The method for classifying articles according to claim 1, wherein before obtaining the text features of the text information based on the text information and a preset target word vector model and a preset target text translation model, the method further comprises:
constructing a word dictionary based on the text information; storing words matched with the words in each text message in the word dictionary;
constructing a word sample set based on the text information and the word dictionary;
training and constructing an initial word vector model based on the word sample set to obtain the target word vector model; and the input quantity and the output quantity of the initial word vector model are matched with the length of the dictionary.
5. The method of classifying an article according to claim 4, wherein said constructing a word dictionary based on said textual information comprises:
performing word segmentation processing on the text information to obtain a first word set;
carrying out normalization processing on the words in the first word set according to word meanings to obtain a second word set;
determining a dictionary length based on a number of different words in the second set of words; matching index numbers to different words in the second word set respectively;
obtaining the word dictionary based on the dictionary length and the index number.
6. The method of classifying an article according to claim 4, wherein said constructing a word sample set based on said text information and said word dictionary comprises:
for each word in the word dictionary, extracting an adjacent word corresponding to the word from the text information;
obtaining a word sample based on the word and the corresponding adjacent words;
and obtaining the word sample set based on the word samples corresponding to all the words in the word dictionary.
7. The method for classifying articles according to claim 1, wherein before obtaining the text features of the text information based on the text information and a preset target word vector model and a preset target text translation model, the method comprises:
obtaining a word vector of each word in the text information based on the text information and the target word vector model;
obtaining the coding characteristics of each word in the text information based on the word vector and the position information of each word and adjacent words;
and training the constructed initial text translation model based on the coding features to obtain the target text translation model.
8. An apparatus for classifying an article, comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring an article data set containing at least one article, and the article comprises image information and text information;
the first obtaining module is used for obtaining the image characteristics of the image information based on the image information and a preset target convolutional neural network model;
the second obtaining module is used for obtaining text characteristics of the text information based on the text information and a preset target word vector model and a preset target text translation model;
a third obtaining module, configured to train a preset initial fully-connected neural network model based on the image features and the text features, and obtain a target fully-connected neural network model;
and the fourth obtaining module is used for inputting the article data set into the target fully-connected neural network model to obtain a classification result.
9. An electronic device, comprising: a processor and a processor coupled to the processor;
the memory for storing a computer program;
the processor for executing the computer program to carry out the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, is adapted to carry out the steps of the method of any one of claims 1 to 7.
CN202111283186.2A 2021-11-01 2021-11-01 Article classification method and device Pending CN114186059A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111283186.2A CN114186059A (en) 2021-11-01 2021-11-01 Article classification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111283186.2A CN114186059A (en) 2021-11-01 2021-11-01 Article classification method and device

Publications (1)

Publication Number Publication Date
CN114186059A true CN114186059A (en) 2022-03-15

Family

ID=80601777

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111283186.2A Pending CN114186059A (en) 2021-11-01 2021-11-01 Article classification method and device

Country Status (1)

Country Link
CN (1) CN114186059A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116226353A (en) * 2023-03-29 2023-06-06 北京百度网讯科技有限公司 Training method of image-text retrieval model, image-text retrieval method, device and equipment
CN117455421A (en) * 2023-12-25 2024-01-26 杭州青塔科技有限公司 Subject classification method and device for scientific research projects, computer equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106777185A (en) * 2016-12-23 2017-05-31 浙江大学 A kind of across media Chinese herbal medicine image search methods based on deep learning
CN110069610A (en) * 2019-03-16 2019-07-30 平安科技(深圳)有限公司 Search method, device, equipment and storage medium based on Solr
CN110851594A (en) * 2019-10-08 2020-02-28 浙江工业大学 Text classification method and device based on multi-channel deep learning model
CN110969015A (en) * 2019-11-28 2020-04-07 国网上海市电力公司 Automatic label identification method and equipment based on operation and maintenance script
CN111666373A (en) * 2020-05-07 2020-09-15 华东师范大学 Chinese news classification method based on Transformer
CN111741330A (en) * 2020-07-17 2020-10-02 腾讯科技(深圳)有限公司 Video content evaluation method and device, storage medium and computer equipment
CN112214599A (en) * 2020-10-20 2021-01-12 电子科技大学 Multi-label text classification method based on statistics and pre-training language model
CN113392249A (en) * 2021-06-25 2021-09-14 北京小米移动软件有限公司 Image-text information classification method, image-text classification model training method, medium, and apparatus

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106777185A (en) * 2016-12-23 2017-05-31 浙江大学 A kind of across media Chinese herbal medicine image search methods based on deep learning
CN110069610A (en) * 2019-03-16 2019-07-30 平安科技(深圳)有限公司 Search method, device, equipment and storage medium based on Solr
CN110851594A (en) * 2019-10-08 2020-02-28 浙江工业大学 Text classification method and device based on multi-channel deep learning model
CN110969015A (en) * 2019-11-28 2020-04-07 国网上海市电力公司 Automatic label identification method and equipment based on operation and maintenance script
CN111666373A (en) * 2020-05-07 2020-09-15 华东师范大学 Chinese news classification method based on Transformer
CN111741330A (en) * 2020-07-17 2020-10-02 腾讯科技(深圳)有限公司 Video content evaluation method and device, storage medium and computer equipment
CN112214599A (en) * 2020-10-20 2021-01-12 电子科技大学 Multi-label text classification method based on statistics and pre-training language model
CN113392249A (en) * 2021-06-25 2021-09-14 北京小米移动软件有限公司 Image-text information classification method, image-text classification model training method, medium, and apparatus

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116226353A (en) * 2023-03-29 2023-06-06 北京百度网讯科技有限公司 Training method of image-text retrieval model, image-text retrieval method, device and equipment
CN117455421A (en) * 2023-12-25 2024-01-26 杭州青塔科技有限公司 Subject classification method and device for scientific research projects, computer equipment and storage medium
CN117455421B (en) * 2023-12-25 2024-04-16 杭州青塔科技有限公司 Subject classification method and device for scientific research projects, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109165380B (en) Neural network model training method and device and text label determining method and device
CN111368049A (en) Information acquisition method and device, electronic equipment and computer readable storage medium
US20220277038A1 (en) Image search based on combined local and global information
CN112163092B (en) Entity and relation extraction method, system, device and medium
CN114186059A (en) Article classification method and device
CN116701431A (en) Data retrieval method and system based on large language model
CN109241534B (en) Examination question automatic generation method and device based on text AI learning
KR102015218B1 (en) Method and apparatus for text classification using machine learning
CN114818891B (en) Small sample multi-label text classification model training method and text classification method
CN113239169A (en) Artificial intelligence-based answer generation method, device, equipment and storage medium
CN110659367A (en) Text classification number determination method and device and electronic equipment
CN110991161A (en) Similar text determination method, neural network model obtaining method and related device
CN112417119A (en) Open domain question-answer prediction method based on deep learning
CN112988982B (en) Autonomous learning method and system for computer comparison space
CN114282513A (en) Text semantic similarity matching method and system, intelligent terminal and storage medium
Asmawati et al. Sentiment analysis of text memes: A comparison among supervised machine learning methods
Touati-Hamad et al. Arabic quran verses authentication using deep learning and word embeddings
CN113627194A (en) Information extraction method and device, and communication message classification method and device
CN116503643A (en) Training method of multi-modal retrieval model, multi-modal retrieval method and device
CN114970467B (en) Method, device, equipment and medium for generating composition manuscript based on artificial intelligence
CN117501283A (en) Text-to-question model system
Riba et al. Learning to rank words: Optimizing ranking metrics for word spotting
CN110196976B (en) Text emotional tendency classification method and device and server
CN113299277A (en) Voice semantic recognition method and system
Petrovic et al. Domain specific word embedding matrix for training neural networks

Legal Events

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