title: Text Classification, How to convert text strings to vector representation
body: <p>I am working on a text classification program. My training data is 700+ text categories and each categories contains 1-350 text phrases. 16k+ phrases total. The data that needs to be classified are text phrases. I want to classify the data so it gives me 5 most similar categories. The training data shares a lot of common words.</p>
  
  <p>My first attempt was using Naive Bayes Theorem using this library on github because this library was very easy to use and allowed me to load my training data as strings. But other users reported issues and when I tried to classify my data, my input is either classified wrong or not classified.  </p>
  
  <p><a href="https://github.com/ptnplanet/Java-Naive-Bayes-Classifier" rel="nofollow noreferrer">https://github.com/ptnplanet/Java-Naive-Bayes-Classifier</a></p>
  
  <p>So I think the library was the issue, so Im going try different libraries and look into k means clustering since my data is high variance.</p>
  
  <p>So when I looking at other libraries, they all require input and training data as a vector matrix. I looked at word2vec and td-idf to convert text vectors. I understand tf-idf, and that I can get the weight of the word compared to the rest of the documents. But how can I use it classify my input data to categories? Would each category be a document? Or would all categories be a single document?</p>
  
  <p>edit:data sample</p>
  
  <p>SEE_BILL-see bill</p>
  
  <p>SEE_BILL-bill balance</p>
  
  <p>SEE_BILL-wheres my bill</p>
  
  <p>SEE_BILL-cant find bill</p>
  
  <p>PAY_BILL-pay bill</p>
  
  <p>PAY_BILL-make payment</p>
  
  <p>PAY_BILL-lower balance</p>
  
  <p>PAY_BILL-remove balance</p>
  
  <p>PAST_BILL-last bill</p>
  
  <p>PAST_BILL-previous bill</p>
  
  <p>PAST_BILL-historical bill</p>
  
  <p>PAST_BILL-bill last year</p>