Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to declare TextBlob var
#1
I'm trying to get this to work inside a def, it works fine if I get rid of def main(): but when I do it this way no go.
I know I need to declare sAnalyze as something, but what? Any help? Thanks in advance!


from textblob import TextBlob
from textblob import Word
import csv

sAnalyze = tuple

def main(): 
    sAnalyze = TextBlob("You did a good job, thumbs up")
#sAnalyze.sentiment()
print("Polarity" + str(sAnalyze.polarity) + "SubJectivity" + str(sAnalyze.subjectivity))

main()
Reply


Messages In This Thread
How to declare TextBlob var - by 3115Tech - Apr-21-2018, 06:22 PM
RE: How to declare TextBlob var - by Larz60+ - Apr-21-2018, 06:43 PM
RE: How to declare TextBlob var - by 3115Tech - Apr-21-2018, 07:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Issue In Loading Textblob in jupyter Shivi_Bhatia 1 6,943 Apr-01-2019, 06:50 PM
Last Post: perfringo
  How to count value after a textblob LoliMarth 1 2,374 Mar-22-2019, 02:20 AM
Last Post: micseydel
  How to declare a dynamic class 'header' Alfalfa 3 3,014 Sep-11-2018, 02:28 PM
Last Post: Alfalfa
  Textblob issue on 3.5 Sebt1890 2 2,921 Mar-01-2018, 09:39 AM
Last Post: buran
  Fastest Way to declare this list. Kowalski 2 2,909 Feb-21-2018, 06:26 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020