Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Examen

Business Report - Problem 2.docx

Puntuación
-
Vendido
-
Páginas
10
Grado
A+
Subido en
30-06-2023
Escrito en
2022/2023

Problem 2: In this particular project, we are going to work on the inaugural corpora from the nltk in Python. We will be looking at the following speeches of the Presidents of the United States of America: 1. President Franklin D. Roosevelt in 1941 2. President John F. Kennedy in 1961 3. President Richard Nixon in 1973  Find the number of characters, words and sentences for the mentioned documents.  Remove all the stopwords from all the three speeches.  Which word occurs the most number of times in his inaugural address for each president? Mention the top three words. (after removing the stopwords)  Plot the word cloud of each of the speeches of the variable. (after removing the stopwords) – Code Snippet to extract the three speeches: " import nltk oad('inaugural') from s import inaugural ds() ('1941-R') ('1961-K') ('1973-N') " Introduction: NLTK will provide you with everything from splitting paragraphs to sentences, splitting words, identifying the part of speech, highlighting themes, and even helping your machine understand what the text is about. Q1. Find the number of characters, words and sentences for the mentioned documents. Answer : We are importing the nltk library to use the s()

Mostrar más Leer menos
Institución
Grado

Vista previa del contenido

Problem 2:
In this particular project, we are going to work on the inaugural corpora from the nltk in
Python. We will be looking at the following speeches of the Presidents of the United States
of America:
1. President Franklin D. Roosevelt in 1941
2. President John F. Kennedy in 1961
3. President Richard Nixon in 1973
 Find the number of characters, words and sentences for the mentioned documents.
 Remove all the stopwords from all the three speeches.
 Which word occurs the most number of times in his inaugural address for each
president? Mention the top three words. (after removing the stopwords)
 Plot the word cloud of each of the speeches of the variable. (after removing the
stopwords) –

Code Snippet to extract the three speeches:
"
import nltk
nltk.download('inaugural')
from nltk.corpus import inaugural
inaugural.fileids()
inaugural.raw('1941-Roosevelt.txt')
inaugural.raw('1961-Kennedy.txt')
inaugural.raw('1973-Nixon.txt')
"
Introduction:
NLTK will provide you with everything from splitting paragraphs to sentences, splitting words,
identifying the part of speech, highlighting themes, and even helping your machine
understand what the text is about.
Q1. Find the number of characters, words and sentences for the mentioned documents.
Answer : We are importing the nltk library to use the inaugural.fileds()




1|Page

, After importing the text file, we would first count the total number of characters in each file
separately. Below is the code to count the char from each file. With the output along with
the screenshot.
# number of Characters in each file




# Number of words in each text file:
Below we are counting the total number of words from each file separately.
Here we are using the split() to split up the words based on space between each word and
we are counting the total number of words by using the len() function.
Output :




2|Page

Escuela, estudio y materia

Grado

Información del documento

Subido en
30 de junio de 2023
Número de páginas
10
Escrito en
2022/2023
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$7.99
Accede al documento completo:

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Conoce al vendedor
Seller avatar
FaiFai

Conoce al vendedor

Seller avatar
FaiFai Harvard College
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
4
Miembro desde
2 año
Número de seguidores
2
Documentos
145
Última venta
1 año hace

0.0

0 reseñas

5
0
4
0
3
0
2
0
1
0

Documentos populares

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes