Question
Prog 5: NLP in Python with NLTK Youll need a 32-bit version of Python installed add a new one from Python.org (like 3.6.1 for x86)
Prog 5: NLP in Python with NLTK
Youll need a 32-bit version of Python installed add a new one from Python.org (like 3.6.1 for x86) if you dont have one already.
Download and install NumPy (Numerical Python): http://sourceforge.net/projects/numpy/files/NumPy/1.10.1/ Or enter: pip3 install numpy at the command prompt
Download and set up NLTK from nltk.org (direct link: https://pypi.python.org/pypi/nltk ) - if you cant run the Windows Installer, youll need to download the Zip or GZipped version, extract, open the setup.py file in IDLE, and run it. Or enter: pip3 install nltk at the command prompt
In the Python Shell, type import nltk to make sure your installation worked.
Go to Ch01 of the NLTK book at http://www.nltk.org/book/ch01.html . Work through sections 1.2 1.4 (except for the plot, unless you want to install matplotlib).
Answer the following in the Comments section of D2L, or in a Word document:
What is the 2017th word of Monty Python and the Holy Grail (make sure you account for zero-based indexing...)? Also, show the command you used to display it from Python.
What is the context of that line? (Hint, show a slice of the text 30 words before and after position 2016) show the command and the output (extra props if you know the scene).
How many unique words of length greater than 14 are in Text2 (Sense & Sensibility)? [See Ch01 s3.2: http://www.nltk.org/book/ch01.html#hapaxes_index_term for help]
What statement(s) did you run in Python to find that number?
Pick one other area of language-processing interest in the HowTo list at http://www.nltk.org/howto/ - either provide 1-2 lines of Python code to demo the functionality, or write 2-3 sentences describing what you found interesting and what NLTK can do (e.g. look at the sentiment analysis how-to, etc.)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started