Questions tagged [textblob]

Simple, Pythonic, text processing--Sentiment analysis, part-of-speech tagging, noun phrase extraction, translation, and more

TextBlob is a Python (2 and 3) library for processing textual data. It provides a simple API for diving into common natural language processing (NLP) tasks such as part-of-speech tagging, noun phrase extraction, sentiment analysis, classification, translation, and more.

342 questions
134
votes
5 answers

Python pickle error: UnicodeDecodeError

I'm trying to do some text classification using Textblob. I'm first training the model and serializing it using pickle as shown below. import pickle from textblob.classifiers import NaiveBayesClassifier with open('sample.csv', 'r') as fp: cl…
90abyss
  • 7,037
  • 19
  • 63
  • 94
23
votes
3 answers

nltk NaiveBayesClassifier training for sentiment analysis

I am training the NaiveBayesClassifier in Python using sentences, and it gives me the error below. I do not understand what the error might be, and any help would be good. I have tried many other input formats, but the error remains. The code given…
student001
  • 533
  • 1
  • 7
  • 20
16
votes
2 answers

Can Pickle handle files larger than the RAM installed on my machine?

I'm using pickle for saving on disk my NLP classifier built with the TextBlob library. I'm using pickle after a lot of searches related to this question. At the moment I'm working locally and I have no problem loading the pickle file (which is…
Nico
  • 6,259
  • 4
  • 24
  • 40
15
votes
4 answers

Replace apostrophe/short words in python

I am using python to clean a given sentence. Suppose that my sentence is: What's the best way to ensure this? I want to convert: What's -> What is Similarly, must've -> must have Also, verbs to original form, told -> tell Singular to plural,…
learner
  • 4,614
  • 7
  • 54
  • 98
12
votes
2 answers

Textblob - HTTPError: HTTP Error 429: Too Many Requests

I am having a dataframe of which one column has a list of strings at each row. On average, each list has 150 words of about 6 characters each. Each of the 700 rows of the dataframe is about a document and each string is a word of this document; so…
Outcast
  • 4,967
  • 5
  • 44
  • 99
12
votes
1 answer

Apply textblob in for each row of a dataframe

i have a data frame with a col which has text. I want to apply textblob and calculate sentiment value for each row. text sentiment this is great great movie great story When i execute the below code: df['sentiment'] =…
user2585048
  • 123
  • 1
  • 1
  • 5
11
votes
3 answers

TextBlob NaiveBayesAnalyzer extremely slow (compared to Pattern)

I'm using TextBlob for python to do some sentiment analysis on tweets. The default analyzer in TextBlob is the PatternAnalyzer which works resonably well and is appreciably fast. sent = TextBlob(tweet.decode('utf-8')).sentiment I have now tried to…
Matt M.
  • 529
  • 5
  • 16
10
votes
1 answer

tf-idf documents of different length

i have searched the web about normalizing tf grades on cases when the documents' lengths are very different (for example, having the documents lengths vary from 500 words to 2500 words) the only normalizing i've found talk about dividing the term…
Shahaf Stein
  • 165
  • 2
  • 14
8
votes
3 answers

Is there a limit on TextBlob translation?

I have been using TextBlob, a package for Python (https://pypi.python.org/pypi/textblob) for translating articles to different language . After reading their docs, I got to know that TextBlob makes use of Google Translate. Since google translate is…
kiran
  • 339
  • 4
  • 18
7
votes
0 answers

HTTPError: HTTP Error 400: Bad Request on translate TextBlob

I'm trying to translate a text with the TextBlob library, but the following HTTPError error is appearing: HTTP Error 400: Bad request, can someone help me with this? Observation: I'm using VSCode to run this script, and I can't use googletrans due…
7
votes
1 answer

Why do I get an HTTP Error 404 when using TextBlob?

I am experiencing some problems using the TextBlob library. I'm trying to run a very simple piece of code like this: from textblob import TextBlob text = 'this is just a test' blob = TextBlob(text) blob.detect_language() And it continually gives me…
Ainulindalë
  • 171
  • 1
  • 5
7
votes
2 answers

Python: NLTK and TextBlob in french

I'm using NLTK and TextBlob to find nouns and noun phrases in a text: from textblob import TextBlob import nltk blob = TextBlob(text) print(blob.noun_phrases) tokenized = nltk.word_tokenize(text) nouns = [word for (word, pos) in…
Sulli
  • 763
  • 1
  • 11
  • 33
7
votes
5 answers

Sentiment analysis of non-English texts

I want to analyze sentiment of texts that are written in German. I found a lot of tutorials on how to do this with English, but I found none on how to apply it to different languages. I have an idea to use the TextBlob Python library to first…
warmspringwinds
  • 1,147
  • 2
  • 14
  • 31
6
votes
1 answer

Using textblob or spacy for correction spelling in french

I would like to correct the misspelled words of a text in french, it seems that spacy is the most accurate and faster package to do it, but it's to complex, I tried with textblob, but I didn't manage to do it with french words. It works perfectly in…
Stella
  • 69
  • 1
  • 10
6
votes
2 answers

How does TextBlob calculate sentiment polarity? How can I calculate a value for sentiment with machine learning classifier?

how does TextBlob calculate an empirical value for the sentiment polarity. I have used naive bayes but it just predicts whether it is positive or negative. How could I calculate a value for the sentiment like TextBlob does?
1
2 3
22 23