Skip to content

Repository files navigation

Intelligent Book Learning Platform 📚🧠

A comprehensive Flask-based AI web application that helps users quickly understand books by generating summaries, mind maps, flashcards, and Q&A pairs using HuggingFace Transformers, PyTorch, and NLP techniques.

✨ Features

  • User Authentication: Secure regicster/login with Flask-Login and bcrypt.
  • Book Parsing: Upload .txt or .pdf files, or paste raw text.
  • AI Summarization: Automatically chunk and summarize texts using sshleifer/distilbart-cnn-12-6.
  • Mind Map Generation: Extractive NLP concept generation visualized interactively via D3.js.
  • Study Flashcards & Q&A: Employs T5 text-to-text generation (via google/flan-t5-small) to create context-aware study material.
  • Admin Dashboard: Administrator views for managing users and books.
  • Standalone CLI Summarizer: Includes a dedicated command-line book summarizer (bart_summarizer.py) for processing large chunks of text directly from the terminal.

📂 Project Structure

Internship_Project/
├── app/                  # Main Flask application package
│   ├── models/           # SQLAlchemy database models
│   ├── routes/           # Application blueprints and routes
│   ├── services/         # Core business logic and AI processing 
│   └── utils/            # Helper functions and utilities
├── static/               # CSS, JS, and image assets
├── templates/            # HTML Jinja2 templates
├── tests/                # Unit tests for the application
├── bart_summarizer.py    # Standalone CLI summarization script
├── requirements.txt      # Python dependencies
├── run.py                # Main entry point for the Flask server
└── .env                  # Environment variables for configuration

🚀 Installation & Setup

  1. Clone the repository and enter the directory

    git clone <repository-url>
    cd Internship_Project
  2. Create a Python Virtual Environment

    python -m venv venv
    # On Windows:
    .\venv\Scripts\Activate.ps1
    # On Linux/Mac:
    source venv/bin/activate
  3. Install Dependencies

    pip install -r requirements.txt

    (Note: This project uses PyTorch and Transformers. Downloading models may require significant storage, e.g., ~300MB for the DistilBART model).

  4. NLTK Setup Run the following to download necessary linguistic data for the mind map extractor:

    python -c "import nltk; nltk.download('punkt'); nltk.download('punkt_tab'); nltk.download('stopwords'); nltk.download('averaged_perceptron_tagger'); nltk.download('averaged_perceptron_tagger_eng')"
  5. Start PostgreSQL Database Ensure PostgreSQL is running locally. Update the database URI in the .env file if necessary:

    DATABASE_URL=postgresql://postgres:postgres@localhost/book_learning_db

    Note: Ensure the database book_learning_db actually exists in your PostgreSQL cluster before running.

💻 Usage

Running the Web Application

python run.py

The Flask app will create necessary database tables automatically upon the first run. Access the app at http://127.0.0.1:5000/.

Running the Standalone CLI Summarizer

You can use the built-in CLI tool to quickly summarize text without starting the web server:

python bart_summarizer.py

🧪 Tests

Run the provided unit tests using:

python -m unittest discover tests/

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages