0% found this document useful (0 votes)
32 views6 pages

NLP Laboratery Manual

Uploaded by

sendmailtop1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views6 pages

NLP Laboratery Manual

Uploaded by

sendmailtop1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

FACULTY OF ENGINEERING AND TECHNOLOGY

BACHELOR OF TECHNOLOGY

Deep Learning With NLP Laboratery


(203105477)

7th - SEMESTER
Computer Science & Engineering Department

NAME :
Kasula PavanKumar
LABORATORY210303124588
MANUAL
ENROLLMENT NUMBER :
FACULTY OF ENGINEERING & TECHNOLOGY
Deep Learning With NLP Laboratory (203105477)
B. Tech – 4th Year 7th Semester

CERTIFICATE

This is to certify Mr.KasulaPavanKumar with Enrollment Number:


210303124588 has successfully completed his laboratory experiments in the
Deep Learning With NLP Laboratory (203105477) from the department of
COMPUTER SCIENCE AND - ENGINEERING during the year 2024-2025.

Date of
Staff in charge HOD SIGNATURE
submission

2|Page ERP Number :210303124588


FACULTY OF ENGINEERING & TECHNOLOGY
Deep Learning With NLP Laboratory (203105477)
B. Tech – 4th Year 7th Semester

INDEX

Sr. Practical Name Page Performance Date Assessment Date Signature


N No:
o
1 Implementation of preprocessing
of Text with NLTK (Tokenization,
Stemming, Lemmatization and 04 17/06/2024
removal of stop words in NLP.
2

10

3|Page ERP Number :210303124588


FACULTY OF ENGINEERING & TECHNOLOGY
Deep Learning With NLP Laboratory (203105477)
B. Tech – 4th Year 7th Semester

PRACTICAL – 01

AIM : Implementation of preprocessing of Text with NLTK (Tokenization, Stemming, Lemmatization and
removal of stop words in NLP.


# Install NLTK
!pip install nltk

# Import NLTK and download necessary datasets


import nltk

nltk.download("all")

OUTPUT :


from nltk.tokenize import sent_tokenize, word_tokenize # Import both functions

text = """
I AM KASULA PAVANKUMAR PURSING MY BACHERLORS FROM PARUL UNIVERSITY AS A ARTIFICAL
INTELLIGENCE STUDENT IAM HAVNG PROFICIENT KNOWLEDGE IN MACHINE LEARNING AND DEEP
LEARNING AND WEB DEVELOPER
"""

# Sentence tokenization
sentences = sent_tokenize(text)
print("Sentence Tokenization:")
print(sentences)

# Word tokenization
words = word_tokenize(text) # Now you can use word_tokenize
print("\nWord Tokenization:")
4|Page ERP Number :210303124588
FACULTY OF ENGINEERING & TECHNOLOGY
Deep Learning With NLP Laboratory (203105477)
B. Tech – 4th Year 7th Semester

print(words)
OUTPUT :


from nltk.stem import PorterStemmer

# Initialize the PorterStemmer


stemmer = PorterStemmer()

# Apply stemming
stemmed_words = [stemmer.stem(word) for word in words]
print("\nStemming:")
print(stemmed_words)

OUTPUT :


from nltk.stem import WordNetLemmatizer

# Initialize the WordNetLemmatizer


lemmatizer = WordNetLemmatizer()

# Apply lemmatization
lemmatized_words = [lemmatizer.lemmatize(word) for word in words]
print("\nLemmatization:")
print(lemmatized_words)

OUTPUT :

5|Page ERP Number :210303124588


FACULTY OF ENGINEERING & TECHNOLOGY
Deep Learning With NLP Laboratory (203105477)
B. Tech – 4th Year 7th Semester

from nltk.corpus import stopwords


# Get the list of stop words
stop_words = set(stopwords.words('english'))

# Remove stop words


filtered_words = [word for word in words if word.lower() not in stop_words]
print("\nRemoval of Stop Words:")
print(filtered_words)

OUTPUT :

6|Page ERP Number :210303124588

You might also like