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
2
votes
3 answers

Tokenize each row in a dataframe - for loop not working

I am trying to tokenize a sentence in a pandas dataframe but I am having some trouble I know this code works to covert just one row TextBlob(df['H'][0]).words But when I tried to apply it in a for loop I got an error for i, row in df.H(): ifor_val…
OptimusPrime
  • 619
  • 8
  • 17
2
votes
1 answer

How to add some noun phrases that I already known when doing noun_chunks in spacy (or np_extractor in textblob)?

I'm using noun_chunks in spacy and np_extractor in textblob to find all phrases in some articles. Their are some technical terms parsed wrong. ex: "ANOVA is also called analysis of variance" and the result shows that noun phrases are "ANOVA",…
Kevin
  • 21
  • 1
2
votes
1 answer

Python TextBlob translate issue

I am doing a quick sentiment analysis console application with Python, TextBlob and NLTK. Currently i am using a link to a wiki article in spanish, so i don't need to translate it and i can use the nltk spanish stopword list, but what if i wanted to…
CarlosT
  • 181
  • 1
  • 18
2
votes
1 answer

Pytesseract output is completely different from the text in the image

The following code runs on my friend's windows laptop perfectly but on mine, it spits out complete garbage. I think it might have something to do with the libraries but I can't say for sure? Can you guys let me know if it runs for you or if you have…
2
votes
2 answers

How to maintain index when splitting sentences into words and reapplying sentiment polarity to each word?

I have a dataframe of sentences that looks like this: text 0 this is great! 1 how dare you?! I can succesfully use TextBlob.words (https://textblob.readthedocs.io/en/dev/quickstart.html#tokenization) to break each sentence into its…
RustyShackleford
  • 3,462
  • 9
  • 40
  • 81
2
votes
0 answers

how to run textblob on localhost?

On my locat host , if i run simple print statement it works fine. but i want to use textblob for sentiment analysis. For this purpose, I am trying to run below code on my localhost but it's showing error. Code: #!C:\fname…
2
votes
3 answers

How to apply TextBlob if value in columns are missing for some rows?

I have a dataframe that looks like this: Text 0 this is amazing 1 nan 2 wow you are great I want to iterate every word in a cell of the dataframe into textblob to get the polarity in a new column. However many rows have nan in them.…
RustyShackleford
  • 3,462
  • 9
  • 40
  • 81
2
votes
1 answer

How to specify my own feature extractor in TextBlob?

I followed this tutorial: http://textblob.readthedocs.io/en/dev/classifiers.html#feature-extractors And I wrote an extractor: def phrases_extractor(document): r.extract_keywords_from_text(document) words = r.get_ranked_phrases() feats =…
Ala Głowacka
  • 323
  • 2
  • 10
2
votes
1 answer

Which is the fastest tokenization function in Python 3?

In Python 3, we can use re.compile(), nltk.tokenize() and TextBlob.words() to tokenize a given text. I think there may be other methods too, but I am unaware of them. Which of these methods or other unmentioned methods tokenizes a given text the…
Shreyas Yakhob
  • 321
  • 1
  • 3
  • 15
2
votes
1 answer

Splitting TextBlob sentiment analysis results into two separate columns - Python Pandas

from textblob import TextBlob def sentiment_calc(text): try: return TextBlob(text).sentiment except: return None test_df['sentiment score'] = test_df['text'].apply(sentiment_calc) test_df I recently ran a code on my…
Leggerless
  • 321
  • 4
  • 16
2
votes
0 answers

TypeError(repr(o) + " is not JSON serializable") for a string with TextBlob

I looked at this answer and this one, but could not find something relevant to my issue. Pretty sure it's a general JSON-related question - not specific to TextBlob. I'm trying to use TextBlob to analyse text parsed from a JSON response to an API.…
SR1
  • 253
  • 1
  • 11
2
votes
0 answers

How to NOT lowercase a text in TextBlob

I am using the library TextBlob to analyse law texts. I really like TextBlob but I am struggling with some features. When I create a TextBlob object, it automatically lowercases my entire text. from textblob import TextBlob text_blob =…
El_Patrón
  • 533
  • 1
  • 10
  • 24
2
votes
2 answers

Sentiment analysis using TextBlob for Dutch language

I want to do sentiment analysis of a list of tweets fetched based on a particular keyword. The tweets coming in are mostly in dutch language and TextBlob needs them converted to English in order to compute the tweet's polarity and subjectivity…
2
votes
2 answers

Textblob sentiment analysis on a csv file

I have a csv file with around 50 rows of sentences. I'm using the textblob sentiment analysis tool. To test the polarity of a sentence, the example shows you write a sentence and the polarity and subjectivity is shown. However, it only works on a…
u.1234
  • 23
  • 1
  • 1
  • 5
2
votes
1 answer

Setting proxy for textblob

I have installed textblob and I want to perform simple translation. >>> text="Hello" >>> blob=TextBlob(text) >>> blob.translate(to="es") The problem is, I dont know where to specify the proxy authentication. Can you tell me where to specify the…
codingsplash
  • 4,785
  • 12
  • 51
  • 90