1
$\begingroup$

I have a small text dataset with 600 comments. My task is a binary classification one. In order to train my model, I transformed the comments into a bag of words using sklearn CountVectorizer. The vocabulary has 1800 words, which is way bigger than the amount of comments. So, how can I reduce the dimensionality of my dataset? I want to know this because I believe that this bigger vocabulary is a problem for the model. I know methods to reduce dimentionality, like PCA, but I do not know if it is as useful in the context of text classification as it is in a tabular dataset. I am also new to nlp, so I wonder if there is a better way to reduce dimensionality, like a way to choose the best words in the vocabulary and use only those.

$\endgroup$

1 Answer 1

1
$\begingroup$

One option is to use a pre-trained embedding space. The pre-trained embedding space will have much lower dimensionality and most likely all of the words in your corpus will be in it.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.