running textblob in python3

  • Last Update :
  • Techknowledgy :

Elementary OS being an Ubuntu derivative,

$ sudo apt - get install python3 - pip
   ...
   $ pip3 install textblob

Suggestion : 2

This will install TextBlob and download the necessary NLTK corpora. If you need to change the default download directory set the NLTK_DATA environment variable.,To get the latest development version of TextBlob, run,If you only intend to use TextBlob’s default models (no model overrides), you can pass the lite argument. This downloads only those corpora needed for basic functionality.,As of TextBlob 0.8.0, TextBlob’s core package was renamed to textblob, whereas earlier versions used a package called text. Therefore, migrating to newer versions should be as simple as rewriting your imports, like so:

$ pip install - U textblob
$ python - m textblob.download_corpora
$ python - m textblob.download_corpora lite
$ conda install - c conda - forge textblob
$ python - m textblob.download_corpora
$ git clone https: //github.com/sloria/TextBlob.git
$ python setup.py install
$ pip install - U git + https: //github.com/sloria/TextBlob.git@dev

Suggestion : 3

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.,Simple, Pythonic text processing. Sentiment analysis, part-of-speech tagging, noun phrase parsing, and more., View statistics for this project via Libraries.io, or by using our public dataset on Google BigQuery ,Word inflection (pluralization and singularization) and lemmatization

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.

from textblob
import TextBlob

text = ''
'
The titular threat of The Blob has always struck me as the ultimate movie
monster: an insatiably hungry, amoeba - like mass able to penetrate
virtually any safeguard, capable of --as a doomed doctor chillingly
describes it--"assimilating flesh on contact.
Snide comparisons to gelatin be damned, it 's a concept with the most
devastating of potential consequences, not unlike the grey goo scenario
proposed by technological theorists fearful of
   artificial intelligence run rampant.
''
'

blob = TextBlob(text)
blob.tags #[('The', 'DT'), ('titular', 'JJ'),
   #('threat', 'NN'), ('of', 'IN'), ...]

blob.noun_phrases # WordList(['titular threat', 'blob',
   # 'ultimate movie monster',
   # 'amoeba-like mass', ...
])

for sentence in blob.sentences:
   print(sentence.sentiment.polarity)
# 0.060
# - 0.341

Get it now

$ pip install - U textblob
$ python - m textblob.download_corpora

Get it now

$ pip install - U textblob
$ python - m textblob.download_corpora

Suggestion : 4

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., Simple, Pythonic, text processing--Sentiment analysis, part-of-speech tagging, noun phrase extraction, translation, and more. , Simple, Pythonic, text processing--Sentiment analysis, part-of-speech tagging, noun phrase extraction, translation, and more. ,Word inflection (pluralization and singularization) and lemmatization

from textblob
import TextBlob

text = ''
'
The titular threat of The Blob has always struck me as the ultimate movie
monster: an insatiably hungry, amoeba - like mass able to penetrate
virtually any safeguard, capable of --as a doomed doctor chillingly
describes it--"assimilating flesh on contact.
Snide comparisons to gelatin be damned, it 's a concept with the most
devastating of potential consequences, not unlike the grey goo scenario
proposed by technological theorists fearful of
   artificial intelligence run rampant.
''
'

blob = TextBlob(text)
blob.tags #[('The', 'DT'), ('titular', 'JJ'),
   #('threat', 'NN'), ('of', 'IN'), ...]

blob.noun_phrases # WordList(['titular threat', 'blob',
   # 'ultimate movie monster',
   # 'amoeba-like mass', ...
])

for sentence in blob.sentences:
   print(sentence.sentiment.polarity)
# 0.060
# - 0.341
1._
from textblob
import TextBlob

text = ''
'
The titular threat of The Blob has always struck me as the ultimate movie
monster: an insatiably hungry, amoeba - like mass able to penetrate
virtually any safeguard, capable of --as a doomed doctor chillingly
describes it--"assimilating flesh on contact.
Snide comparisons to gelatin be damned, it 's a concept with the most
devastating of potential consequences, not unlike the grey goo scenario
proposed by technological theorists fearful of
   artificial intelligence run rampant.
''
'

blob = TextBlob(text)
blob.tags #[('The', 'DT'), ('titular', 'JJ'),
   #('threat', 'NN'), ('of', 'IN'), ...]

blob.noun_phrases # WordList(['titular threat', 'blob',
   # 'ultimate movie monster',
   # 'amoeba-like mass', ...
])

for sentence in blob.sentences:
   print(sentence.sentiment.polarity)
# 0.060
# - 0.341

Get it now

$ pip install - U textblob
$ python - m textblob.download_corpora

Suggestion : 5

It appears that TextBlob was installed, because when I see something in /opt/tljh/user/lib/python3.7/site-packages, /opt/conda/lib/python3.8/site-packages, and in my home directory’s .local/lib/python2.7 directory. My path includes /opt/tljh/user/bin, where there is python3.7, so right now I’m not seeing where the environment has gone wrong. Any tips?,…also without success. The response is always “ModuleNotFoundError: No module named ‘TextBlob’”, even though I can see it right there in /opt/tljh/user/lib/python3.7/site-packages, and even though my PATH (/opt/tljh/user/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin) appears to point to the right place.,As it happens, on two of my test instances, when I try from textblob import TextBlob in my test environment I got nothing at all instead of an error. After entering this I can then go on to get TextBlob responses using the examples in the TextBlob Quickstart tutorial. This looks like proper behavior.,I did try installing it as a pip package (using sudo -E pip install textblob in the Notebook Terminal), but it doesn’t look like these instructions work—admin users are supposed to have “full root access to the server with passwordless sudo”, but this does not appear to be the case.

Then after trying the suggestion, I’d try try running the following inside a notebook cell when you signed in as admin account.

% conda install - c conda - forge textblob

In this post (and here), I see the import statement run like below and then it gives a more detailed error report:

from textblob
import TextBlob