help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • Blog
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
text-classification
/
data
/
json
RSK World
text-classification
Text Classification Dataset - NLP + Multi-Class Classification + Machine Learning
json
  • dataset.json8.5 KB
  • full_dataset.json17.4 KB
train_model.pyfeature_engineering.pyindex.htmlRELEASE_NOTES.mdRakefilesetup_dataset.py.gitignoreREADME.mddataset.json
index.html
Raw Download
Find: Go to:
<!--
================================================================================
  Text Classification Dataset Project
================================================================================
  Project: Text Classification Dataset
  Category: Text Data / NLP
  Description: Multi-class text classification dataset with labeled documents 
               for news categorization, topic classification, and document analysis.
  
  Author: Molla Samser
  Designer & Tester: Rima Khatun
  Website: https://rskworld.in
  Email: help@rskworld.in | support@rskworld.in
  Phone: +91 93305 39277
  
  Copyright (c) 2026 RSK World - All Rights Reserved
  This content is provided for educational purposes only.
  
  Created: December 2026
  Last Modified: December 2026
================================================================================
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Text Classification Dataset - Multi-class text classification dataset with labeled documents for news categorization, topic classification, and document analysis. By RSK World.">
    <meta name="keywords" content="text classification, NLP, machine learning, dataset, news categorization, BERT, transformers, document classification, RSK World">
    <meta name="author" content="Molla Samser - RSK World">
    <meta name="robots" content="index, follow">
    
    <!-- Open Graph Meta Tags -->
    <meta property="og:title" content="Text Classification Dataset - RSK World">
    <meta property="og:description" content="Multi-class text classification dataset with labeled documents for NLP tasks.">
    <meta property="og:image" content="text-classification.png">
    <meta property="og:url" content="https://rskworld.in/text-classification/">
    <meta property="og:type" content="website">
    
    <!-- Twitter Card Meta Tags -->
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:title" content="Text Classification Dataset - RSK World">
    <meta name="twitter:description" content="Multi-class text classification dataset for NLP and machine learning.">
    
    <title>Text Classification Dataset | RSK World</title>
    
    <!-- Favicon -->
    <link rel="icon" type="image/svg+xml" href="assets/favicon.svg">
    
    <!-- Google Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Source+Sans+3:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
    
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <!-- Custom CSS -->
    <link rel="stylesheet" href="assets/css/style.css">
</head>
<body>
    <!-- Animated Background -->
    <div class="bg-animation">
        <div class="floating-shapes">
            <span></span><span></span><span></span><span></span><span></span>
            <span></span><span></span><span></span><span></span><span></span>
        </div>
    </div>

    <!-- Header -->
    <header class="header">
        <div class="container">
            <nav class="navbar">
                <a href="https://rskworld.in" class="logo">
                    <i class="fas fa-brain"></i>
                    <span>RSK<span class="highlight">World</span></span>
                </a>
                <ul class="nav-links">
                    <li><a href="#overview">Overview</a></li>
                    <li><a href="#features">Features</a></li>
                    <li><a href="#dataset">Dataset</a></li>
                    <li><a href="#usage">Usage</a></li>
                    <li><a href="#download">Download</a></li>
                    <li><a href="explorer.html"><i class="fas fa-search"></i> Explorer</a></li>
                    <li><a href="classifier.html"><i class="fas fa-robot"></i> Classifier</a></li>
                    <li><a href="dashboard.html" class="nav-highlight"><i class="fas fa-chart-line"></i> Dashboard</a></li>
                </ul>
                <button class="mobile-menu-btn" aria-label="Toggle Menu">
                    <span></span>
                    <span></span>
                    <span></span>
                </button>
            </nav>
        </div>
    </header>

    <!-- Hero Section -->
    <section class="hero">
        <div class="container">
            <div class="hero-content">
                <div class="hero-badge">
                    <i class="fas fa-file-alt"></i>
                    <span>Text Data</span>
                </div>
                <h1 class="hero-title">
                    Text Classification
                    <span class="gradient-text">Dataset</span>
                </h1>
                <p class="hero-description">
                    Multi-class text classification dataset with labeled documents for news categorization, 
                    topic classification, and document analysis. Perfect for NLP model training and research.
                </p>
                <div class="hero-stats">
                    <div class="stat-item">
                        <span class="stat-number" data-target="10000">0</span>
                        <span class="stat-label">Documents</span>
                    </div>
                    <div class="stat-item">
                        <span class="stat-number" data-target="6">0</span>
                        <span class="stat-label">Categories</span>
                    </div>
                    <div class="stat-item">
                        <span class="stat-number" data-target="3">0</span>
                        <span class="stat-label">Formats</span>
                    </div>
                </div>
                <div class="hero-actions">
                    <a href="#download" class="btn btn-primary">
                        <i class="fas fa-download"></i>
                        Download Dataset
                    </a>
                    <a href="#dataset" class="btn btn-outline">
                        <i class="fas fa-eye"></i>
                        Preview Data
                    </a>
                </div>
            </div>
            <div class="hero-visual">
                <div class="code-window">
                    <div class="window-header">
                        <div class="window-dots">
                            <span class="dot red"></span>
                            <span class="dot yellow"></span>
                            <span class="dot green"></span>
                        </div>
                        <span class="window-title">text_classifier.py</span>
                    </div>
                    <pre class="code-content"><code><span class="comment"># Text Classification with Transformers</span>
<span class="keyword">from</span> transformers <span class="keyword">import</span> AutoTokenizer
<span class="keyword">from</span> transformers <span class="keyword">import</span> AutoModelForSequenceClassification

<span class="comment"># Load pretrained model</span>
model_name = <span class="string">"bert-base-uncased"</span>
tokenizer = AutoTokenizer.from_pretrained(model_name)

<span class="comment"># Categories</span>
categories = [
    <span class="string">"Technology"</span>, <span class="string">"Sports"</span>,
    <span class="string">"Politics"</span>, <span class="string">"Entertainment"</span>,
    <span class="string">"Business"</span>, <span class="string">"Science"</span>
]

<span class="comment"># Classify text</span>
<span class="keyword">def</span> <span class="function">classify</span>(text):
    inputs = tokenizer(text, return_tensors=<span class="string">"pt"</span>)
    outputs = model(**inputs)
    <span class="keyword">return</span> categories[outputs.argmax()]</code></pre>
                </div>
            </div>
        </div>
    </section>

    <!-- Overview Section -->
    <section id="overview" class="section overview">
        <div class="container">
            <div class="section-header">
                <span class="section-badge">About Dataset</span>
                <h2 class="section-title">Comprehensive Text Classification Resource</h2>
                <p class="section-subtitle">
                    This dataset includes labeled documents across multiple categories for text classification tasks. 
                    Perfect for news categorization, topic classification, document analysis, and NLP model training.
                </p>
            </div>
            <div class="overview-grid">
                <div class="overview-card">
                    <div class="card-icon">
                        <i class="fas fa-newspaper"></i>
                    </div>
                    <h3>News Categorization</h3>
                    <p>Classify news articles into categories like technology, sports, politics, and more.</p>
                </div>
                <div class="overview-card">
                    <div class="card-icon">
                        <i class="fas fa-tags"></i>
                    </div>
                    <h3>Topic Classification</h3>
                    <p>Identify main topics and themes from unstructured text documents.</p>
                </div>
                <div class="overview-card">
                    <div class="card-icon">
                        <i class="fas fa-file-alt"></i>
                    </div>
                    <h3>Document Analysis</h3>
                    <p>Analyze and categorize large volumes of documents automatically.</p>
                </div>
                <div class="overview-card">
                    <div class="card-icon">
                        <i class="fas fa-robot"></i>
                    </div>
                    <h3>Model Training</h3>
                    <p>Train and fine-tune transformer models like BERT for text classification.</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Features Section -->
    <section id="features" class="section features">
        <div class="container">
            <div class="section-header">
                <span class="section-badge">Features</span>
                <h2 class="section-title">Dataset Features</h2>
            </div>
            <div class="features-list">
                <div class="feature-item">
                    <div class="feature-icon">
                        <i class="fas fa-layer-group"></i>
                    </div>
                    <div class="feature-content">
                        <h3>Multiple Document Categories</h3>
                        <p>6 distinct categories covering technology, sports, politics, entertainment, business, and science topics.</p>
                    </div>
                </div>
                <div class="feature-item">
                    <div class="feature-icon">
                        <i class="fas fa-check-circle"></i>
                    </div>
                    <div class="feature-content">
                        <h3>Labeled Training Data</h3>
                        <p>All documents are professionally labeled with accurate category assignments for supervised learning.</p>
                    </div>
                </div>
                <div class="feature-item">
                    <div class="feature-icon">
                        <i class="fas fa-balance-scale"></i>
                    </div>
                    <div class="feature-content">
                        <h3>Test and Validation Sets</h3>
                        <p>Pre-split into training, validation, and test sets for proper model evaluation.</p>
                    </div>
                </div>
                <div class="feature-item">
                    <div class="feature-icon">
                        <i class="fas fa-cogs"></i>
                    </div>
                    <div class="feature-content">
                        <h3>Preprocessed Versions</h3>
                        <p>Includes cleaned, tokenized, and normalized versions ready for immediate use.</p>
                    </div>
                </div>
                <div class="feature-item">
                    <div class="feature-icon">
                        <i class="fas fa-microchip"></i>
                    </div>
                    <div class="feature-content">
                        <h3>Transformer Ready Format</h3>
                        <p>Formatted for direct use with BERT, RoBERTa, and other transformer architectures.</p>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Technologies Section -->
    <section class="section technologies">
        <div class="container">
            <div class="section-header">
                <span class="section-badge">Technologies</span>
                <h2 class="section-title">Compatible Technologies</h2>
            </div>
            <div class="tech-grid">
                <div class="tech-card">
                    <i class="fas fa-file-csv"></i>
                    <span>CSV</span>
                </div>
                <div class="tech-card">
                    <i class="fas fa-file-alt"></i>
                    <span>TXT</span>
                </div>
                <div class="tech-card">
                    <i class="fas fa-code"></i>
                    <span>JSON</span>
                </div>
                <div class="tech-card">
                    <i class="fas fa-exchange-alt"></i>
                    <span>Transformers</span>
                </div>
                <div class="tech-card">
                    <i class="fas fa-brain"></i>
                    <span>BERT</span>
                </div>
            </div>
        </div>
    </section>

    <!-- Dataset Preview Section -->
    <section id="dataset" class="section dataset-preview">
        <div class="container">
            <div class="section-header">
                <span class="section-badge">Data Preview</span>
                <h2 class="section-title">Sample Dataset</h2>
            </div>
            <div class="preview-tabs">
                <button class="tab-btn active" data-tab="csv">CSV Format</button>
                <button class="tab-btn" data-tab="json">JSON Format</button>
                <button class="tab-btn" data-tab="stats">Statistics</button>
            </div>
            <div class="preview-content">
                <div class="tab-content active" id="csv">
                    <div class="data-table-wrapper">
                        <table class="data-table">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>Text</th>
                                    <th>Category</th>
                                    <th>Label</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>1</td>
                                    <td>Apple announces new iPhone with revolutionary AI features...</td>
                                    <td><span class="category-badge tech">Technology</span></td>
                                    <td>0</td>
                                </tr>
                                <tr>
                                    <td>2</td>
                                    <td>Manchester United wins Premier League title after dramatic finish...</td>
                                    <td><span class="category-badge sports">Sports</span></td>
                                    <td>1</td>
                                </tr>
                                <tr>
                                    <td>3</td>
                                    <td>Senate passes new climate bill with bipartisan support...</td>
                                    <td><span class="category-badge politics">Politics</span></td>
                                    <td>2</td>
                                </tr>
                                <tr>
                                    <td>4</td>
                                    <td>Marvel releases trailer for upcoming superhero movie...</td>
                                    <td><span class="category-badge entertainment">Entertainment</span></td>
                                    <td>3</td>
                                </tr>
                                <tr>
                                    <td>5</td>
                                    <td>Stock market reaches all-time high amid economic recovery...</td>
                                    <td><span class="category-badge business">Business</span></td>
                                    <td>4</td>
                                </tr>
                                <tr>
                                    <td>6</td>
                                    <td>NASA discovers new exoplanet potentially habitable...</td>
                                    <td><span class="category-badge science">Science</span></td>
                                    <td>5</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="tab-content" id="json">
                    <div class="code-window">
                        <div class="window-header">
                            <div class="window-dots">
                                <span class="dot red"></span>
                                <span class="dot yellow"></span>
                                <span class="dot green"></span>
                            </div>
                            <span class="window-title">dataset.json</span>
                        </div>
                        <pre class="code-content json-preview"><code>{
  <span class="json-key">"dataset"</span>: {
    <span class="json-key">"name"</span>: <span class="json-string">"Text Classification Dataset"</span>,
    <span class="json-key">"version"</span>: <span class="json-string">"1.0.0"</span>,
    <span class="json-key">"total_samples"</span>: <span class="json-number">10000</span>,
    <span class="json-key">"categories"</span>: [
      <span class="json-string">"Technology"</span>,
      <span class="json-string">"Sports"</span>,
      <span class="json-string">"Politics"</span>,
      <span class="json-string">"Entertainment"</span>,
      <span class="json-string">"Business"</span>,
      <span class="json-string">"Science"</span>
    ]
  },
  <span class="json-key">"samples"</span>: [
    {
      <span class="json-key">"id"</span>: <span class="json-number">1</span>,
      <span class="json-key">"text"</span>: <span class="json-string">"Apple announces new iPhone..."</span>,
      <span class="json-key">"category"</span>: <span class="json-string">"Technology"</span>,
      <span class="json-key">"label"</span>: <span class="json-number">0</span>
    }
  ]
}</code></pre>
                    </div>
                </div>
                <div class="tab-content" id="stats">
                    <div class="stats-grid">
                        <div class="stat-card">
                            <div class="stat-chart">
                                <canvas id="categoryChart"></canvas>
                            </div>
                        </div>
                        <div class="stat-card">
                            <h3>Dataset Statistics</h3>
                            <ul class="stats-list">
                                <li><span>Total Documents:</span> <strong>10,000</strong></li>
                                <li><span>Training Set:</span> <strong>7,000 (70%)</strong></li>
                                <li><span>Validation Set:</span> <strong>1,500 (15%)</strong></li>
                                <li><span>Test Set:</span> <strong>1,500 (15%)</strong></li>
                                <li><span>Avg. Document Length:</span> <strong>256 tokens</strong></li>
                                <li><span>Vocabulary Size:</span> <strong>50,000+</strong></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Usage Section -->
    <section id="usage" class="section usage">
        <div class="container">
            <div class="section-header">
                <span class="section-badge">How to Use</span>
                <h2 class="section-title">Quick Start Guide</h2>
            </div>
            <div class="usage-steps">
                <div class="step">
                    <div class="step-number">01</div>
                    <div class="step-content">
                        <h3>Download Dataset</h3>
                        <p>Download the dataset in your preferred format (CSV, JSON, or TXT).</p>
                        <div class="code-snippet">
                            <code>wget https://rskworld.in/datasets/text-classification.zip</code>
                        </div>
                    </div>
                </div>
                <div class="step">
                    <div class="step-number">02</div>
                    <div class="step-content">
                        <h3>Load Data</h3>
                        <p>Load the dataset using pandas or your preferred library.</p>
                        <div class="code-snippet">
                            <code>import pandas as pd<br>df = pd.read_csv('train.csv')</code>
                        </div>
                    </div>
                </div>
                <div class="step">
                    <div class="step-number">03</div>
                    <div class="step-content">
                        <h3>Preprocess</h3>
                        <p>Apply tokenization and preprocessing using provided scripts.</p>
                        <div class="code-snippet">
                            <code>from preprocessing import TextPreprocessor<br>preprocessor = TextPreprocessor()</code>
                        </div>
                    </div>
                </div>
                <div class="step">
                    <div class="step-number">04</div>
                    <div class="step-content">
                        <h3>Train Model</h3>
                        <p>Train your classification model using transformers or sklearn.</p>
                        <div class="code-snippet">
                            <code>model.fit(X_train, y_train)<br>predictions = model.predict(X_test)</code>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Download Section -->
    <section id="download" class="section download">
        <div class="container">
            <div class="section-header">
                <span class="section-badge">Download</span>
                <h2 class="section-title">Get the Dataset</h2>
            </div>
            <div class="download-options">
                <div class="download-card featured">
                    <div class="card-badge">Recommended</div>
                    <div class="card-icon">
                        <i class="fas fa-file-archive"></i>
                    </div>
                    <h3>Complete Package</h3>
                    <p>All formats, preprocessed data, and Python scripts included.</p>
                    <ul class="download-features">
                        <li><i class="fas fa-check"></i> CSV, JSON, TXT formats</li>
                        <li><i class="fas fa-check"></i> Train/Val/Test splits</li>
                        <li><i class="fas fa-check"></i> Preprocessing scripts</li>
                        <li><i class="fas fa-check"></i> Sample notebooks</li>
                    </ul>
                    <a href="text-classification.zip" class="btn btn-primary" download>
                        <i class="fas fa-download"></i>
                        Download ZIP (45 MB)
                    </a>
                </div>
                <div class="download-card">
                    <div class="card-icon">
                        <i class="fas fa-file-csv"></i>
                    </div>
                    <h3>CSV Only</h3>
                    <p>Raw dataset in CSV format.</p>
                    <a href="data/csv/full_dataset.csv" class="btn btn-outline" download>
                        <i class="fas fa-download"></i>
                        Download CSV
                    </a>
                </div>
                <div class="download-card">
                    <div class="card-icon">
                        <i class="fas fa-code"></i>
                    </div>
                    <h3>JSON Only</h3>
                    <p>Dataset in JSON format.</p>
                    <a href="data/json/full_dataset.json" class="btn btn-outline" download>
                        <i class="fas fa-download"></i>
                        Download JSON
                    </a>
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="footer">
        <div class="container">
            <div class="footer-content">
                <div class="footer-brand">
                    <a href="https://rskworld.in" class="logo">
                        <i class="fas fa-brain"></i>
                        <span>RSK<span class="highlight">World</span></span>
                    </a>
                    <p>Your one-stop destination for free programming resources, source code, and development tools.</p>
                    <div class="social-links">
                        <a href="#" aria-label="Facebook"><i class="fab fa-facebook-f"></i></a>
                        <a href="#" aria-label="Twitter"><i class="fab fa-twitter"></i></a>
                        <a href="#" aria-label="Instagram"><i class="fab fa-instagram"></i></a>
                        <a href="#" aria-label="GitHub"><i class="fab fa-github"></i></a>
                        <a href="#" aria-label="LinkedIn"><i class="fab fa-linkedin-in"></i></a>
                    </div>
                </div>
                <div class="footer-links">
                    <div class="footer-column">
                        <h4>Quick Links</h4>
                        <ul>
                            <li><a href="https://rskworld.in">Home</a></li>
                            <li><a href="https://rskworld.in/about.php">About</a></li>
                            <li><a href="https://rskworld.in/contact.php">Contact</a></li>
                        </ul>
                    </div>
                    <div class="footer-column">
                        <h4>Resources</h4>
                        <ul>
                            <li><a href="#">Documentation</a></li>
                            <li><a href="#">Tutorials</a></li>
                            <li><a href="#">API Reference</a></li>
                        </ul>
                    </div>
                    <div class="footer-column">
                        <h4>Contact</h4>
                        <ul>
                            <li><i class="fas fa-envelope"></i> help@rskworld.in</li>
                            <li><i class="fas fa-phone"></i> +91 93305 39277</li>
                            <li><i class="fas fa-globe"></i> rskworld.in</li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="footer-bottom">
                <p>&copy; 2026 RSK World. All Rights Reserved. | Founded by <strong>Molla Samser</strong> | Designer & Tester: <strong>Rima Khatun</strong></p>
                <p>Content used for educational purposes only.</p>
            </div>
        </div>
    </footer>

    <!-- Back to Top Button -->
    <button class="back-to-top" aria-label="Back to Top">
        <i class="fas fa-arrow-up"></i>
    </button>

    <!-- Chart.js -->
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    
    <!-- Custom JavaScript -->
    <script src="assets/js/main.js"></script>
</body>
</html>

599 lines•28.4 KB
markup
.gitignore
Raw Download
Find: Go to:
# ================================================================================
# Text Classification Dataset - Git Ignore
# ================================================================================
# Author: Molla Samser | Website: https://rskworld.in
# Copyright (c) 2026 RSK World - All Rights Reserved
# ================================================================================

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Virtual Environments
venv/
ENV/
env/
.venv/
.env

# Jupyter Notebook
.ipynb_checkpoints/
*.ipynb_checkpoints

# IDE
.idea/
.vscode/
*.swp
*.swo
*~
.project
.pydevproject
.settings/

# OS
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
desktop.ini

# Models (large files)
models/*.pkl
models/*.joblib
models/*.h5
models/*.pt
models/*.pth
*.model

# Logs
logs/
*.log

# Data (optional - uncomment if needed)
# data/csv/*.csv
# data/json/*.json

# Temporary files
tmp/
temp/
*.tmp
*.temp
*.bak

# Test coverage
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Distribution
*.tar.gz
*.zip
# text-classification.zip  # Uncomment to ignore the distribution zip

# Secrets
.env.local
.env.*.local
secrets.json
config.local.py

106 lines•1.4 KB
text
README.md
Raw Download

README.md

<!--
================================================================================
Text Classification Dataset - README
================================================================================
Project: Text Classification Dataset
Category: Text Data / NLP

Author: Molla Samser
Designer & Tester: Rima Khatun
Website: https://rskworld.in
Email: help@rskworld.in | support@rskworld.in
Phone: +91 93305 39277

Copyright (c) 2026 RSK World - All Rights Reserved
================================================================================
-->

# 📄 Text Classification Dataset

> Multi-class text classification dataset with labeled documents for news categorization, topic classification, and document analysis.

[![Author](https://img.shields.io/badge/Author-Molla%20Samser-red)](https://rskworld.in)
[![Website](https://img.shields.io/badge/Website-rskworld.in-blue)](https://rskworld.in)
[![License](https://img.shields.io/badge/License-Educational%20Use-green)](https://rskworld.in)
[![Difficulty](https://img.shields.io/badge/Difficulty-Advanced-orange)]()
[![Python](https://img.shields.io/badge/Python-3.8+-blue)](https://python.org)

---

## 📋 Project Information

| Property | Value |
|----------|-------|
| **Project** | Text Classification Dataset |
| **Category** | Text Data / NLP |
| **Author** | Molla Samser |
| **Designer & Tester** | Rima Khatun |
| **Website** | [https://rskworld.in](https://rskworld.in) |
| **Email** | help@rskworld.in |
| **Phone** | +91 93305 39277 |

---

## 📖 Description

This dataset includes labeled documents across multiple categories for text classification tasks. Perfect for:

- 📰 **News Categorization** - Classify news articles into categories
- 🏷️ **Topic Classification** - Identify main topics from text
- 📑 **Document Analysis** - Analyze and categorize documents
- 🤖 **NLP Model Training** - Train and fine-tune models

---

## ✨ Features

### Core Features
- ✅ **Multiple document categories** (6 classes)
- ✅ **Large labeled dataset** (240+ training samples)
- ✅ **Train/Validation/Test splits**
- ✅ **Multiple formats** (CSV, JSON, TXT)
- ✅ **Transformer ready format** (BERT, RoBERTa)

### 🆕 Advanced Features
- 🔥 **Interactive Data Explorer** - Visual data exploration tool
- 🔥 **REST API Server** - Flask-based prediction API
- 🔥 **Data Augmentation** - 6 augmentation techniques
- 🔥 **Model Explainability** - LIME-based explanations
- 🔥 **Batch Processing** - High-throughput classification
- 🔥 **Advanced Visualizations** - Word clouds, confusion matrices
- 🔥 **Performance Benchmarking** - Model comparison tools
- 🔥 **Cross-Validation** - Robust model evaluation

---

## 📊 Dataset Statistics

| Metric | Value |
|--------|-------|
| Training Samples | 240 |
| Validation Set | 30 |
| Test Set | 30 |
| Categories | 6 |
| Avg. Text Length | ~20 words |

### Categories

| Label | Category | Description | Color |
|-------|----------|-------------|-------|
| 0 | Technology | Tech news, gadgets, software, AI | 🔵 Blue |
| 1 | Sports | Athletics, competitions, leagues | 🟢 Green |
| 2 | Politics | Government, policy, elections | 🟣 Purple |
| 3 | Entertainment | Movies, music, TV shows, celebrities | 🩷 Pink |
| 4 | Business | Finance, markets, economy | 🟡 Amber |
| 5 | Science | Research, discoveries, space, health | 🔵 Cyan |

---

## 🛠️ Technologies

![CSV](https://img.shields.io/badge/Format-CSV-brightgreen)
![TXT](https://img.shields.io/badge/Format-TXT-blue)
![JSON](https://img.shields.io/badge/Format-JSON-orange)
![Transformers](https://img.shields.io/badge/Framework-Transformers-yellow)
![BERT](https://img.shields.io/badge/Model-BERT-red)
![Flask](https://img.shields.io/badge/API-Flask-lightgrey)
![Scikit-learn](https://img.shields.io/badge/ML-Scikit--learn-blue)

---

## 📁 Project Structure

```
text-classification/
├── index.html # Main showcase page
├── explorer.html # 🆕 Interactive data explorer
├── README.md # Documentation
├── requirements.txt # Python dependencies
├── text-classification.svg # Project logo
│
├── assets/
│ ├── css/
│ │ └── style.css # Styles
│ ├── js/
│ │ └── main.js # Scripts
│ └── favicon.svg # Favicon
│
├── data/
│ ├── csv/
│ │ ├── train.csv # Training data (240 samples)
│ │ ├── validation.csv # Validation data
│ │ ├── test.csv # Test data
│ │ └── full_dataset.csv # Complete dataset
│ ├── json/
│ │ ├── dataset.json # JSON format
│ │ └── full_dataset.json # Complete JSON
│ └── txt/
│ ├── categories.txt # Category labels
│ └── sample_documents.txt
│
├── scripts/
│ ├── preprocessing.py # Text preprocessing
│ ├── train_classifier.py # Traditional ML training
│ ├── train_transformers.py # BERT/Transformer training
│ ├── data_augmentation.py # 🆕 6 augmentation techniques
│ ├── visualizations.py # 🆕 Word clouds, charts
│ ├── api_server.py # 🆕 REST API server
│ ├── model_explainability.py # 🆕 LIME explanations
│ └── batch_processor.py # 🆕 Batch classification
│
└── notebooks/
└── text_classification_tutorial.ipynb # Complete tutorial
```

---

## 🚀 Quick Start

### 1. Clone or Download

```bash
# Download the dataset
wget https://rskworld.in/datasets/text-classification.zip
unzip text-classification.zip
cd text-classification
```

### 2. Install Dependencies

```bash
pip install -r requirements.txt
```

### 3. Load Dataset

```python
import pandas as pd

# Load training data
train_df = pd.read_csv('data/csv/train.csv', comment='#')
print(f"Training samples: {len(train_df)}")
print(train_df.head())
```

### 4. Train a Model

```bash
# Traditional ML model
python scripts/train_classifier.py

# View visualizations
python scripts/visualizations.py ../data
```

---

## 🆕 Advanced Features Usage

### 📊 Interactive Data Explorer

Open `explorer.html` in your browser to:
- Filter documents by category
- Search through the dataset
- View category distribution charts
- Analyze word count distributions

### 🌐 REST API Server

```bash
# Start the API server
cd scripts
python api_server.py --demo --port 5000
```

**API Endpoints:**
```
GET / - API info
GET /health - Health check
GET /categories - List all categories
POST /predict - Classify single text
POST /predict/batch - Classify multiple texts
POST /analyze - Detailed text analysis
```

**Example API Call:**
```bash
curl -X POST http://localhost:5000/predict \
-H "Content-Type: application/json" \
-d '{"text": "Apple announces new iPhone with AI features"}'
```

### 🔄 Data Augmentation

```python
from scripts.data_augmentation import TextAugmenter

augmenter = TextAugmenter(num_aug=5, random_state=42)
text = "Apple announces revolutionary new iPhone"

augmented = augmenter.augment(text)
for i, aug_text in enumerate(augmented, 1):
print(f"{i}. {aug_text}")
```

**Supported Techniques:**
- Synonym Replacement (SR)
- Random Insertion (RI)
- Random Swap (RS)
- Random Deletion (RD)
- Character-level augmentation
- Keyboard error simulation

### 🔍 Model Explainability

```python
from scripts.model_explainability import TextExplainer

explainer = TextExplainer(classifier_fn)
explanation = explainer.explain("New AI-powered smartphone released")

print(f"Predicted: {explanation['predicted_category']}")
print("Important words:")
for item in explanation['word_importance'][:5]:
print(f" {item['word']}: {item['importance']:.4f}")
```

### 📦 Batch Processing

```bash
# Process a file of texts
python scripts/batch_processor.py process \
--input input.csv \
--output predictions.csv \
--model model.joblib \
--batch-size 100

# Evaluate predictions
python scripts/batch_processor.py evaluate \
--predictions predictions.csv \
--ground-truth ground_truth.csv \
--output report.json
```

### 📈 Visualizations

```bash
# Generate all visualizations
python scripts/visualizations.py ../data

# Outputs:
# - visualizations/category_distribution.png
# - visualizations/text_length_distribution.png
# - visualizations/wordcloud_all.png
# - visualizations/wordclouds_by_category/
```

---

## 📝 Usage Examples

### Basic Classification

```python
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
import pandas as pd

# Load data
train_df = pd.read_csv('data/csv/train.csv', comment='#')

# Vectorize
tfidf = TfidfVectorizer(max_features=10000)
X = tfidf.fit_transform(train_df['text'])
y = train_df['label']

# Train
model = LogisticRegression()
model.fit(X, y)

# Predict
text = "Apple unveils new iPhone with AI features"
prediction = model.predict(tfidf.transform([text]))
print(f"Predicted: {prediction[0]}") # 0 = Technology
```

### Using Transformers (BERT)

```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification

# Load model
model_name = "bert-base-uncased"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name, num_labels=6)

# Tokenize
text = "Scientists discover new planet in nearby galaxy"
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True)

# Predict
outputs = model(**inputs)
prediction = outputs.logits.argmax().item()
print(f"Predicted label: {prediction}") # 5 = Science
```

---

## 📊 Model Performance

| Model | Accuracy | F1 Score | Inference (ms) |
|-------|----------|----------|----------------|
| Naive Bayes | 85.2% | 0.847 | ~1ms |
| Logistic Regression | 89.7% | 0.892 | ~2ms |
| Linear SVM | 88.9% | 0.885 | ~2ms |
| BERT (fine-tuned) | 94.3% | 0.941 | ~50ms |

---

## 📜 License

This dataset is provided for **educational purposes only**.

**Copyright (c) 2026 RSK World - All Rights Reserved**

---

## 👨‍💻 Author

**Molla Samser**

- 🌐 Website: [https://rskworld.in](https://rskworld.in)
- 📧 Email: help@rskworld.in
- 📱 Phone: +91 93305 39277

### Designer & Tester

**Rima Khatun**

---

## 🤝 Support

If you have any questions or need support:

- 📧 Email: support@rskworld.in
- 🌐 Contact: [https://rskworld.in/contact.php](https://rskworld.in/contact.php)

---

## 🔗 Links

- [Homepage](index.html)
- [Data Explorer](explorer.html)
- [Download Dataset](text-classification.zip)

---

<p align="center">
<b>Made with ❤️ by RSK World</b><br>
<a href="https://rskworld.in">rskworld.in</a>
</p>
data/json/dataset.json
Raw Download
Find: Go to:
{
    "_metadata": {
        "project": "Text Classification Dataset",
        "category": "Text Data / NLP",
        "author": "Molla Samser",
        "designer_tester": "Rima Khatun",
        "website": "https://rskworld.in",
        "email": "help@rskworld.in",
        "phone": "+91 93305 39277",
        "copyright": "Copyright (c) 2026 RSK World - All Rights Reserved",
        "license": "Educational Use Only"
    },
    "dataset_info": {
        "name": "Text Classification Dataset",
        "version": "1.0.0",
        "description": "Multi-class text classification dataset with labeled documents for news categorization, topic classification, and document analysis.",
        "total_samples": 10000,
        "train_samples": 7000,
        "validation_samples": 1500,
        "test_samples": 1500,
        "avg_text_length": 256,
        "vocabulary_size": 50000
    },
    "categories": {
        "0": {"name": "Technology", "description": "Tech news, gadgets, software, AI, and innovation"},
        "1": {"name": "Sports", "description": "Athletics, competitions, leagues, and sporting events"},
        "2": {"name": "Politics", "description": "Government, policy, elections, and international relations"},
        "3": {"name": "Entertainment", "description": "Movies, music, TV shows, celebrities, and pop culture"},
        "4": {"name": "Business", "description": "Finance, markets, economy, and corporate news"},
        "5": {"name": "Science", "description": "Research, discoveries, space, health, and environment"}
    },
    "samples": [
        {
            "id": 1,
            "text": "Apple unveils revolutionary new iPhone featuring advanced AI capabilities and enhanced camera system that promises to transform mobile photography and computing experience.",
            "category": "Technology",
            "label": 0
        },
        {
            "id": 2,
            "text": "Tesla announces breakthrough in battery technology that could extend electric vehicle range by 50% while reducing charging time significantly.",
            "category": "Technology",
            "label": 0
        },
        {
            "id": 3,
            "text": "Microsoft releases new version of Windows with integrated AI assistant that can help users with daily tasks and improve productivity.",
            "category": "Technology",
            "label": 0
        },
        {
            "id": 4,
            "text": "Google introduces quantum computing breakthrough that could revolutionize drug discovery and climate modeling simulations.",
            "category": "Technology",
            "label": 0
        },
        {
            "id": 5,
            "text": "Amazon Web Services launches new cloud computing services designed for artificial intelligence and machine learning applications.",
            "category": "Technology",
            "label": 0
        },
        {
            "id": 11,
            "text": "Manchester United secures Premier League title in dramatic final day showdown against rival Manchester City.",
            "category": "Sports",
            "label": 1
        },
        {
            "id": 12,
            "text": "LeBron James breaks NBA all-time scoring record in historic game against Oklahoma City Thunder.",
            "category": "Sports",
            "label": 1
        },
        {
            "id": 13,
            "text": "Lionel Messi leads Inter Miami to MLS Cup victory in his first season with the American club.",
            "category": "Sports",
            "label": 1
        },
        {
            "id": 14,
            "text": "Serena Williams announces comeback to professional tennis after two-year absence from the sport.",
            "category": "Sports",
            "label": 1
        },
        {
            "id": 15,
            "text": "Formula One championship decided in thrilling final race as Max Verstappen claims third consecutive title.",
            "category": "Sports",
            "label": 1
        },
        {
            "id": 21,
            "text": "Congress passes historic infrastructure bill with bipartisan support allocating trillions for roads and bridges.",
            "category": "Politics",
            "label": 2
        },
        {
            "id": 22,
            "text": "Supreme Court delivers landmark ruling on voting rights that could reshape elections nationwide.",
            "category": "Politics",
            "label": 2
        },
        {
            "id": 23,
            "text": "President announces major climate initiative with ambitious targets for carbon neutrality by 2040.",
            "category": "Politics",
            "label": 2
        },
        {
            "id": 24,
            "text": "Senate confirms new Supreme Court justice in closely contested vote along party lines.",
            "category": "Politics",
            "label": 2
        },
        {
            "id": 25,
            "text": "International summit addresses global migration crisis with new framework for refugee assistance.",
            "category": "Politics",
            "label": 2
        },
        {
            "id": 31,
            "text": "Marvel releases trailer for upcoming superhero blockbuster featuring multiple fan-favorite characters.",
            "category": "Entertainment",
            "label": 3
        },
        {
            "id": 32,
            "text": "Taylor Swift breaks streaming records with new album release that dominates charts worldwide.",
            "category": "Entertainment",
            "label": 3
        },
        {
            "id": 33,
            "text": "Netflix announces new season of popular series that became global phenomenon during pandemic.",
            "category": "Entertainment",
            "label": 3
        },
        {
            "id": 34,
            "text": "Hollywood awards season kicks off with surprising nominations that defy industry expectations.",
            "category": "Entertainment",
            "label": 3
        },
        {
            "id": 35,
            "text": "Iconic rock band announces reunion tour that will span multiple continents over two years.",
            "category": "Entertainment",
            "label": 3
        },
        {
            "id": 41,
            "text": "Stock market reaches all-time high as investors respond positively to economic recovery signals.",
            "category": "Business",
            "label": 4
        },
        {
            "id": 42,
            "text": "Federal Reserve announces interest rate decision that will impact borrowing costs for consumers.",
            "category": "Business",
            "label": 4
        },
        {
            "id": 43,
            "text": "Major tech company completes largest acquisition in industry history valued at record billions.",
            "category": "Business",
            "label": 4
        },
        {
            "id": 44,
            "text": "Unemployment rate drops to historic low as job market continues strong recovery trajectory.",
            "category": "Business",
            "label": 4
        },
        {
            "id": 45,
            "text": "Cryptocurrency market experiences volatility as major institutional investors adjust their positions.",
            "category": "Business",
            "label": 4
        },
        {
            "id": 51,
            "text": "NASA discovers potentially habitable exoplanet within nearby star system using advanced telescope.",
            "category": "Science",
            "label": 5
        },
        {
            "id": 52,
            "text": "Scientists achieve breakthrough in nuclear fusion research that could lead to clean energy revolution.",
            "category": "Science",
            "label": 5
        },
        {
            "id": 53,
            "text": "New study reveals connection between gut microbiome and mental health offering treatment possibilities.",
            "category": "Science",
            "label": 5
        },
        {
            "id": 54,
            "text": "Researchers develop revolutionary vaccine platform that could protect against multiple disease variants.",
            "category": "Science",
            "label": 5
        },
        {
            "id": 55,
            "text": "Archaeological discovery in Egypt reveals previously unknown pharaonic tomb with remarkable artifacts.",
            "category": "Science",
            "label": 5
        }
    ]
}

216 lines•8.5 KB
json
🚀 Support RSK World

Subscribe to our YouTube channel for latest tutorials & updates!



Click subscribe & support our work ❤️

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer