Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Make sure to import NLTK in python and all of books . Answer the following questions along with Python code and its result. 1. Produce

Make sure to import NLTK in python and all of books. Answer the following questions along with Python code and its result.

1. Produce a dispersion plot of the four main protagonists in Sense and Sensibility: Elinor, Marianne, Edward, and Willoughby. What can you observe about the different roles played by the males and females in this novel? Can you identify the couples?

Hint: text2 is Sense and sensibility text given by NLTK use dispersion_plot() for your reference, NO need to include graph.

2. Define a variable my_sent to be a list of words, using the syntax my_sent = ["My", "sent"] (but with your own words, or a favorite saying).

a. Use ' '.join(my_sent) to convert this into a string.

b. Use split() to split the string back into the list form you had to start with.

3. The first sentence of text3 is provided to you in the variable sent3. The index of the in sent3 is 1, because sent3[1] gives us 'the'. What are the indexes of the two other occurrences of this word - the in sent3?

4. What is the difference between the following two lines? Which one will give a larger value? Will this be the case for other texts?

>>> sorted(set([w.lower() for w in text1]))

>>> sorted([w.lower() for w in set(text1)])

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Murach's SQL Server 2012 For Developers

Authors: Bryan Syverson, Joel Murach, Mike Murach

1st Edition

1890774693, 9781890774691

More Books

Students also viewed these Databases questions

Question

Explain the conversion of short-term to tong-term memory.

Answered: 1 week ago