CSC 5993 Sentiment Analysis Spring 2018

RESOURCES


Installing Python 3.4 & NLTK 3.0

  • Instructions - Installing NLTK and Python (follow these, step-by-step)
  • Windows
    1. Install Python 3.4 or newer here
    2. Open a Command Prompt (Look for it in the Start menu under All Programs->Accessories), and see if pip is accessible from the command line by typing:
      • pip
    3. If pip was found, skip this step. Otherwise, change to the Python scripts directory by typing one of the following (adjust for the version of Python you installed):
      • cd \Python34\Scripts
      • cd \Users\Wildcat\AppData\Local\Programs\Python\Python35-32\Scripts\
    4. Install Numpy:
      • pip install -U numpy
    5. Install NLTK by typing in the Command Prompt:
      • pip install -U nltk
    6. Install BeautifulSoup by typing:
      • pip install beautifulsoup4
         
  • Mac
    1. Install Python 3.4 or newer here
    2. Open a Terminal window (Look for it in Applications in the Finder)
    3. See if you have pip installed already by typing in the Terminal window:
      • pip
    4. If it doesn't look like pip is installed, do this:
      • Install Easy Setup by saving ez_setup.py someplace easy to find, then double-click on the file to run it.
      • Install Pip by typing in the Terminal window:
        • sudo easy_install pip
    5. Install Numpy (optional) by typing:
      • sudo pip3 install -U numpy
    6. Install NLTK, by typing:
      • sudo pip3 install -U nltk
    7. Install BeautifulSoup by typing:
      • sudo pip3 install -U BeautifulSoup4
    8. Make sure BeautifulSoup installed correctly by typing the following into the IDLE Shell:
      • from bs4 import BeautifulSoup
         
  • NLTK Problems
    1. If you encounter error messages when running a Python program and the error mentions some package in NLTK, you can fix the problem by downloading the package. Type the following in an open IDLE shell:
      • import nltk
      • nltk.download()
    2. Once the user interface pops up, find the missing module and download it.
       
  • Missing Corpus
    • If an error message says that names or movie_reviews is missing, use the same NLTK import approach as above. Type the following into IDLE:
      • import nltk
      • nltk.download()
    • Click on the Corpora tab, and find the missing corpus and download it.
       
  • Textblob Missing
    • If you see an error message about textblob not being found, this is fixed at the command line.
    • Windows
      • Open a command prompt, and type the following:
      • cd C:\Python34\Scripts
      • pip install -U textblob
      • cd ..
      • python -m textblob.download_corpora
    • Mac
      • Open a Terminal window (Look for it in Applications in the Finder), and type the following:
      • sudo pip install -U textblob
      • sudo python -m textblob.download_corpora
      • If you get a textblob not found error message when running the last command, try this in IDLE:
        • import nltk
        • nltk.download()
        • Click on the Models tab of the window that pops up and download punkt (Punkt Tokenizer Models).
      • If you still get a textblob not found error message, or similar, try this in the Terminal window:
        • sudo -H pip3 install -U textblob
        • sudo -H python3 -m textblob.download_corpora
        • Fun fact: The reason you might need to do this is because Macs often come with Python 2.7 pre-installed so you have to use pip3 (for Python 3.x) in this case rather than just pip to install things in the right place.

French Textual Analysis

Python

General Information Sources

Data Resources

Last updated: 01/15/2018