Category : sentiment-analysis

I faced some issues when I tried to use textblob to analyze 10million data. For the data, I’ve also used Vader packages to handle the same data, it worked well. My original code was: def textblob_polarity(text): polarity = [] for mess in text: mood = TextBlob(mess) polarity.append(mood.sentiment.polarity) return polarity textblob_polarity = textblob_polarity(data[‘body’]) data[‘textblob_polarity’] = textblob_polarity ..

Read more

I am working on sentiment analysis where after preprocessing the dataset of strings i have to change them into numbers to perform logistic regression. It took almost 10 minutes to preprocess the dataset of 400,000 examples token by token. So i saved the preprocessed dataset as a CSV file. Opened the file and use TfidVectoriser ..

Read more

Here is a snippet of the code: # input for term to be searched and how many tweets to search searchTerm = input("Enter Keyword/Tag to search about: ") NoOfTerms = int(input("Enter how many tweets to search: ")) # searching for tweets self.tweets = tweepy.Cursor(api.search, q=searchTerm, lang = "en").items(NoOfTerms) Source: Python..

Read more

This is the error info+ most recent call KeyError Traceback (most recent call last) D:pythonlibsite-packagespandascoreindexesbase.py in get_loc(self, key, method, tolerance) 3079 try: -> 3080 return self._engine.get_loc(casted_key) 3081 except KeyError as err: pandas_libsindex.pyx in pandas._libs.index.IndexEngine.get_loc() pandas_libsindex.pyx in pandas._libs.index.IndexEngine.get_loc() pandas_libshashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item() pandas_libshashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item() KeyError: 1 The above exception was the direct cause of the following ..

Read more