Monday, 8 October 2018

Multiclass Text Classification in Python

I am trying to create a Multiclass Text Classifier as explained here. However, my code is breaking at line:

NB_pipeline.fit(X_train, train[category])

Below is the error which I am getting:

File "pandas\hashtable.pyx", line 683, in pandas.hashtable.PyObjectHashTable.get_item (pandas\hashtable.c:12322)

I tried to find out what train[category] returns and I got same error.

1) X_train is a dataframe with one column and contains customer feedback.

2) train is a dataframe with two columns; first column contains customer review(same as X_train) and second column contains one of the 5 categories (Systems Error, Proactive Communication, Staff Behaviour, Website Functionalities, Others).

3) category is one of the above mentioned categories.

Below is the sample train dataframe:

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



from Multiclass Text Classification in Python

No comments:

Post a Comment