import nltk from textblob import TextBlob nltk.download('punkt') nltk.download('movie_reviews') nltk.download('wordnet') from textblob.sentiments import NaiveBayesAnalyzer # Define the text to analyze text = '''Apple is a very successful company due to its visionary leadership team. They have a very bright future''' # Creating a TextBlob object with the NaiveBayesAnalyzer blob_naive_bayes = TextBlob(text, analyzer=NaiveBayesAnalyzer()) # Performing sentiment analysis with the NaiveBayesAnalyzer sentiment_naive_bayes = blob_naive_bayes.sentiment # Printing the results print("NaiveBayesAnalyzer Sentiment:", sentiment_naive_bayes)