title: Multiclass Text Classification in Python
body: <p>I am trying to create a Multiclass Text Classifier as explained <a href="https://towardsdatascience.com/multi-label-text-classification-with-scikit-learn-30714b7819c5" rel="nofollow noreferrer">here</a>. However, my code is breaking at line:</p>
  
  <pre><code>NB_pipeline.fit(X_train, train[category])
  </code></pre>
  
  <p>Below is the error which I am getting:</p>
  
  <pre><code>File "pandas\hashtable.pyx", line 683, in pandas.hashtable.PyObjectHashTable.get_item (pandas\hashtable.c:12322)
  </code></pre>
  
  <p>I tried to find out what <code>train[category]</code> returns and I got same error. </p>
  
  <p>1) <code>X_train</code> is a <code>dataframe</code> with one column and contains customer feedback. </p>
  
  <p>2) <code>train</code> is a <code>dataframe</code> with two columns; first column contains customer review(same as <code>X_train</code>) and second column contains one of the 5 categories (<code>Systems Error, Proactive Communication, Staff Behaviour, Website Functionalities, Others</code>).</p>
  
  <p>3) <code>category</code> is one of the above mentioned categories.</p>
  
  <p>Below is the sample train <code>dataframe</code>:</p>
  
  <pre><code>Index           Feedback                                    Category
    0           While making payment got system error.         System error
                Staff behaviour was good at hotel
  
    1           While making payment got system error.         Staff Behaviour
                Staff behaviour was good at hotel
  </code></pre>