Skip to content

Huzaifa-367/Text-Preprocessing-with-NLTK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Text Preprocessing with NLTK

Overview

This repository contains Python code demonstrating text preprocessing using the Natural Language Toolkit (NLTK) library. Text preprocessing is an essential step in natural language processing (NLP) projects, where raw text data is cleaned and transformed to prepare it for analysis or modeling tasks.

Features

  • Removes punctuations, URLs, and stop words from text data
  • Performs tokenization, stemming, and lemmatization
  • Segments text into sentences

Dependencies

  • Python 3.x
  • NLTK

Installation

  1. Clone this repository:

    git clone https://github.com/your_username/text-preprocessing-nltk.git
    cd text-preprocessing-nltk
  2. Install the required dependencies using pip:

    pip install -r requirements.txt

Usage

  1. Ensure you have your text data ready. You can either use the provided sample data or replace it with your own dataset.

  2. Run the preprocessing script:

    python preprocess.py
  3. View the preprocessed text output in the console.

Sample Data

The sample data file data.jsonl contains JSON Lines formatted text entries. Each entry has a "text" field representing the raw text data.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • NLTK developers for providing a powerful natural language processing library.

Releases

No releases published

Packages

No packages published