COG 376 "In
class" lab
Today we are going
to explore ways for you to use the Natural Language Toolkit
METHOD
ONE: USING THE SOFTWARE LOADED ON THE COMPUTER DEPARTMENT SERVERS
To
use this method, you need a way to be able to log onto the servers.
There are two ways of
doing this:
1) Go to an open
terminal in Shineman 446.
A) Log onto a machine using your Laker Net user name and
password.
B) Open a terminal session.
C) At
the terminal prompt, type:
ssh pi.cs.oswego.edu
And
use your password to log onto the "pi" serv
D) Then go to the section below marked "Today's Lab"
E) BE SURE TO LOG OFF WHEN YOU ARE FINISHED!!!
2)
If you are using your own computer, you can use the "Putty"
program.
A) Check (under the "programs"
link if you are using Windows) to see if you have Putty already
installed on your computer.
B) If not,
you can go to:
http://www.putty.org/
and you can download a copy of the Putty program onto your
computer.
Note: If you are a
MAC user, read the comments regarding MACs.
C) Start the putty program. A dialogue box should appear. In the slot
marked "Host Name(or IP Address)" type:
pi.cs.oswego.edu
D) Log onto the
server using your user name and password.
E) Follow the directions for using
the programs given to you in the text.
F) BE SURE TO LOG OFF WHEN YOU ARE FINISHED!!
NOTE: YOU CAN USE PUTTY FROM ANY COMPUTER IN A UNIVERSITY COMPUTER
LAB.
METHOD
TWO: YOU CAN DOWNLOAD THE NATURAL LANGUAGE TOOLKIT ON YOUR OWN
MACHINE
Go to
http://www.nltk.org/install.html
You should be using either Windows or MAC OS.
Make sure that you download the appropriate software on
your
machine.
Follow the instructions for downloading the
software for the Natural Language Toolkit.
TODAY'S
LAB:
Go
to http://www.nltk.org/book/
Do
the following sections:
A) Getting started with Python
B)
Getting started with NLTK
IMPORTANT: when you start with the NLTK, skip the nltk.download() step in the text instructions- just enter the import statment.
See below:
|
Then go to the next section of the textbook and enter this instruction:
from nltk.book import *
NOTE: IF YOU ARE RUNNING THE NLTK ON YOUR OWN MACHINE, YOU MIGHT
NEED TO DOWNLOAD SOME ADDITIONAL FILES THAT ARE TEXT CORPORA.
C)
Try using the concordance function (found in the section, "Searching
Text").
D) Try using the length function (found in
the section, "Counting Vocabulary").