6 Replies Latest reply on Jul 15, 2018 11:50 PM by bharath.nair.0

    Python integration with Tableau - NLP tokenization




      I am trying to use TabPy to analyze text data in Tableau. I wanted to break down the text into words(tokenize) and then create their frequency counters using Python calculations.



      I was able to use nltk tokenizer, but was getting an error saying that string is expected; whereas the return value from python script was string, and calculation had script_Str. See below



      • An error occurred while communicating with the Predictive Service.
      • Error processing script
      • TypeError : expected string or bytes-like object


      Here is my calculation



      "from nltk.tokenize import word_tokenize

      data = _arg1

      return str(word_tokenize(data)[1])





      Any help is highly appreciated.