I am very new to programming and python; coming from functional background. I am currently using a tutorial: https://www.analyticsvidhya.com/blog/2019/04/predicting-movie-genres-nlp-multi-label-classification/

The purpose of this tutorial is to build a model that can predict genre of a movie just using the plot details (available in Text Form). I am mapping this concept to create tag/prediction of customer complaint registerenter image description here.

For example: 1 Movie --> Many Genres (horror, fantasy)

1 complain --> many Genre (Warranty, Air Conditioning)

I am currently up to the stage to make the genre into list format then get the genre tags in a list (unique) but I don't how to achieve it in Python.

i.e. line 0 i showing Warranty and Heating/Cooling as 1 value instead of having its own quote ''?

  • $\begingroup$ Could you clarify the question a bit more? Are you trying to get a list of unique genres from a given list of genres (i.e from Out[1] in the image you provide)? $\endgroup$ – serali Dec 6 '19 at 5:31
  • $\begingroup$ Hi Serali. There are 2 things I want to achieve: (1) to split/break the value of that field individually (at the moment: ' warranty airconditioning' is considered as 1 value in that field) and make it as a list. (2) to sum and count the unique value of the genre column (of those fields in the list). $\endgroup$ – J.L Dec 8 '19 at 21:44
  • $\begingroup$ ` #To convert multivalue into list of a column #Create an empty array called Test #Tag is the DF Name #Genre is the column Name #genre_new is the newly created column name to hold the value of Test Array Test = [] Test = Tag['Genre'].str.split(", ").tolist() Tag['genre_new'] = Test ` $\endgroup$ – J.L Dec 12 '19 at 11:04

Your Answer

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

Browse other questions tagged or ask your own question.