[Python] Can't iterare Textblob classifier in a dataframe

Discussão em 'Python' iniciado por Stack, Junho 10, 2025.

  1. Stack

    Stack Membro Participativo

    I've been successful in training a TextBlob NaiveBayes sentiment classifier, with fairly high accuracy, and I'm trying to iterate it in a comment dataset to do a coder reliability test. The only issue is that the method listed on the TextBlob documentation only applies to single strings. Here's the test I ran over a list of tuples named "blobs":

    blob = TextBlob(blobs, classifier=cl)
    blob.classify()


    And here's the error:

    TypeError: The `text` argument passed to `__init__(text)` must be a string, not <class 'list'>


    How can I bypass this obstacle?

    Continue reading...

Compartilhe esta Página