PRACTICAL NO.
01: Text Preprocessing and Linguistic Basics
AIM:
The aim of this practical is to understand the fundamental concepts of text preprocessing
and linguistic basics used in Natural Language Processing (NLP). This includes tokenization,
stopword removal, stemming, lemmatization, and basic morphological analysis using
Python NLP libraries.
INTRODUCTION:
Natural Language Processing deals with enabling computers to understand, analyze, and
generate human language. Raw textual data is unstructured and contains noise such as
punctuation, stopwords, and different word forms. Text preprocessing is a crucial step to
convert raw text into a structured and meaningful format suitable for analysis.
THEORY:
1. TEXT PREPROCESSING:
Text preprocessing refers to a set of techniques used to clean and prepare text data before
applying NLP algorithms. It helps reduce complexity, remove unnecessary information, and
improve processing efficiency.
2. TOKENIZATION:
Tokenization is the process of breaking text into smaller units called tokens.
Types of Tokenization:
- Sentence Tokenization: Splitting text into individual sentences.
- Word Tokenization: Splitting sentences into words or symbols.
Tokenization is essential because most NLP algorithms work on individual tokens rather
than raw text.
3. MORPHOLOGY:
Morphology is the study of the structure and formation of words. It focuses on identifying
morphemes, which are the smallest meaningful units of language.
Examples:
- Root word: play
- Prefix: re (restart)
- Suffix: ing (playing)
Morphological analysis helps in understanding how words are formed and related.
4. STOPWORDS:
Stopwords are commonly used words such as “is”, “the”, “and”, “in”, etc. These words do not
contribute significant meaning to text analysis. Removing stopwords reduces noise and
improves the quality of results.
5. PUNCTUATION REMOVAL:
Punctuation marks such as commas, periods, and symbols are generally not useful in text
analysis. Removing them simplifies processing and helps focus on meaningful words.
6. STEMMING:
Stemming is the process of reducing words to their root form by removing suffixes.
Examples:
- playing → play
- studies → studi
Stemming is fast but may not always produce valid dictionary words.
7. LEMMATIZATION:
Lemmatization converts words into their base or dictionary form known as a lemma.
Examples:
- playing → play
- better → good
Lemmatization is more accurate than stemming as it considers grammatical context.
8. FREQUENCY ANALYSIS:
Frequency analysis involves counting how often words or roots appear in a text corpus. It is
useful for identifying important terms and is widely used in text mining and machine
learning applications.
APPLICATIONS:
- Information retrieval
- Sentiment analysis
- Chatbots
- Text classification
- Machine translation
CONCLUSION:
In this practical, students learn how raw text data is transformed into a clean and
structured format. Understanding text preprocessing and linguistic basics is essential for
building efficient NLP applications.