Multiclass classification and pre-trained word embedding (word2vec & GloVe) support and it's comparison
Hi Denny, Thanks very much for the great blog and the source code. I just started with machine learning and this article helped me a lot to learn machine learning, especially with text classification. I extended your code to support multiclass classification and to use word embeddings with either word2vec or GloVe. The code is available at: https://github.com/cahya-wirawan/cnn-text-classification-tf I made a comparison of multiclass classification and with/without pre-trained word embeddings. The 20newsgroup text dataset has been used for this purpose. I used only 4 from 20 available topics from the dataset, but it is easy to change it, I provided a configuration file to simplify the support for multiclass functionality, difference datasets and pre-trained word embedding. Moreover, I have compared the result of this cnn text classification with naive bayesian and support vector machine (SVM) using the scikit-learn: https://github.com/cahya-wirawan/ML-Collection/blob/master/TextClassification.py Here is the result: | Metric | Naive Bayes | SVM | CNN w/o pre-trained word embedding | CNN with word2vec | CNN with GloVe | | :---: | :---: | :---: | :---: | :---: | :---: | | Accuracy | 0.83 | 0.91 | 0.88 | **0.95** | **0.95** | | Training time | < 1s | < 1s | > 6h | > 6h | > 6h | The accuracy of text classification using CNN but without pre-trained word embedding is less then SVM, but still better than the accuracy of NB. The pre-trained word embeddings improves so the accur
Posted by cahya-wirawan on Feb 22, 2017, 2:10 PM
Tags
Related issues
Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments
support (EdTech)
proposal: all: add bare metal support
AMD hardware support for training and Inference
Android Version
[Feature Request] Music / Audio support
Implement PlatformView support on Linux
[feature request] very basic support for MPI debugging multiple processes at the same time
UEFI?
Gitea hosted Gitea
Multiclass classification and pre-trained word embedding (word2vec & GloVe) support and it's comparison
Hi Denny, Thanks very much for the great blog and the source code. I just started with machine learning and this article helped me a lot to learn machine learning, especially with text classification. I extended your code to support multiclass classification and to use word embeddings with either word2vec or GloVe. The code is available at: https://github.com/cahya-wirawan/cnn-text-classification-tf I made a comparison of multiclass classification and with/without pre-trained word embeddings. The 20newsgroup text dataset has been used for this purpose. I used only 4 from 20 available topics from the dataset, but it is easy to change it, I provided a configuration file to simplify the support for multiclass functionality, difference datasets and pre-trained word embedding. Moreover, I have compared the result of this cnn text classification with naive bayesian and support vector machine (SVM) using the scikit-learn: https://github.com/cahya-wirawan/ML-Collection/blob/master/TextClassification.py Here is the result: | Metric | Naive Bayes | SVM | CNN w/o pre-trained word embedding | CNN with word2vec | CNN with GloVe | | :---: | :---: | :---: | :---: | :---: | :---: | | Accuracy | 0.83 | 0.91 | 0.88 | **0.95** | **0.95** | | Training time | < 1s | < 1s | > 6h | > 6h | > 6h | The accuracy of text classification using CNN but without pre-trained word embedding is less then SVM, but still better than the accuracy of NB. The pre-trained word embeddings improves so the accur
Comments (0)
No comments yet. Start the discussion.