Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

Business Report - Problem 2.docx

Beoordeling
-
Verkocht
-
Pagina's
10
Cijfer
A+
Geüpload op
30-06-2023
Geschreven in
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()

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

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

Geschreven voor

Vak

Documentinformatie

Geüpload op
30 juni 2023
Aantal pagina's
10
Geschreven in
2022/2023
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$7.99
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
FaiFai

Maak kennis met de verkoper

Seller avatar
FaiFai Harvard College
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
4
Lid sinds
3 jaar
Aantal volgers
2
Documenten
145
Laatst verkocht
1 jaar geleden

0.0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen