Planning a classifier to recognize specific documents based on text. Categories are mutually exclusive and include: job application resumes, paychecks, quarterly financial reports etc, and data is text extracted from doc, pdf, xls etc.

At the feature engineering stage, with questions in mind:

  1. One Multiclass classifier or a number of One vs. Rest (one per category)?
  2. Word embedding (Word2Vec/GloVe) - one embedding for all categories or a separate embedding for each category?

My tendency is towards a number of one vs. rest classifiers (to allow for dynamic use of just some of the categories), and one embedding for all categories (to save prediction time).

Project architecture: initially basic LogReg, but will soon develop to CNN / CNN+RNN.

Project scale:

  • Training: a few hundreds per category
  • Prediction: millions of files

Please feel free to share any insights or references, thank you

  • $\begingroup$ Your data seems to be easily separable (financial reports do not use nearly the same word distribution as resumes, right?). My first reaction would be to apply Naive-Bayes in the bag-of-words or Tf-Idf representation, and see if it gives a good enough result. $\endgroup$
    – Mephy
    Dec 3, 2017 at 11:16
  • $\begingroup$ The final objective is to detect such files among millions of other files (of many different types), so the feature representation and classifier must be able not only to separate among those categories, but also to detect files belonging to those categories out of a pool of documents. $\endgroup$
    – Adam
    Dec 3, 2017 at 12:29

1 Answer 1


I would suggest to have a look at fasttext, it will learn word embeddings for you from your corpus (advantage over word2vec embedding is that it learns representations based on character ngrams, so if a word is there, but its plural is not, it will still have a similar representation) and then in the supervised learning mode it uses something very simple like regression for classification, provided you have examples of labelled data. I tried it with trivial 20newsgroups and it works well for distinct categories. Maybe not a production-friendly solution (it's in c++, but can be stretched to python, albeit not without pain), but can give an idea. Given the nature of the algorithm, it's quick, compared to nets.

  • $\begingroup$ Thank you, tried it before for this purpose but as you said I am looking for a more robust, production-friendly solution. $\endgroup$
    – Adam
    Feb 25, 2018 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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