Skip to main content

AI-based Help Bot for Information Retrieval from MOSDAC using a Knowledge Graph

Project description

Here's a professional, clean, and complete README.md for your ISRO HelpBot project, optimized for both GitHub and PyPI packaging:


# ๐Ÿš€ ISRO HelpBot

An AI-powered conversational assistant designed for information retrieval from ISRO's knowledge resources using a Knowledge Graph, Natural Language Processing (NLP), and semantic search. Built for the [ISRO Bharatiya Antariksh Hackathon 2025](https://www.isrohack.in/), this project aims to revolutionize access to space-related information.

---

## ๐Ÿ“Œ Features

- ๐Ÿ”Ž **Query Understanding**: Extracts intent and named entities from natural language queries.
- ๐Ÿง  **Knowledge Graph Builder**: Builds a semantic knowledge graph from `.txt`, `.pdf`, `.docx`, and `.xlsx` documents.
- ๐ŸŒ **Geospatial Awareness**: Recognizes and links locations (e.g., "Bay of Bengal", "17ยฐN") from queries and documents.
- ๐Ÿ’ฌ **Frontend Chat UI**: Built using Streamlit with file upload and interactive conversation.
- โš™๏ธ **Backend API**: FastAPI-powered backend to serve query results via RESTful endpoints.
- ๐Ÿ“ˆ **Evaluation Metrics**: Real-time performance metrics to assess accuracy and responsiveness.

---

## ๐Ÿ—‚๏ธ Project Structure
ISRO HELPBOT/
โ”œโ”€โ”€ __pycache__/                       # Compiled Python bytecode
โ”œโ”€โ”€ .vscode/                           # VS Code settings for development
โ”‚   โ””โ”€โ”€ settings.json                  # Editor preferences and configurations
โ”‚
โ”œโ”€โ”€ api/                               # FastAPI backend for handling API requests
โ”‚   โ”œโ”€โ”€ __pycache__/
โ”‚   โ”œโ”€โ”€ data/                          # API-level data files (temporary or static)
โ”‚   โ”œโ”€โ”€ static/                        # Static assets for FastAPI (CSS, JS, etc.)
โ”‚   โ”œโ”€โ”€ __init__.py                    # Marks directory as a Python package
โ”‚   โ”œโ”€โ”€ main_api.py                    # Uvicorn entrypoint with FastAPI app instance
โ”‚   โ”œโ”€โ”€ query_handler.py               # Logic to handle and respond to queries via API
โ”‚   โ””โ”€โ”€ routes.py                      # API endpoint definitions and routing
โ”‚
โ”œโ”€โ”€ app/                               # Supplementary app scripts
โ”‚   โ”œโ”€โ”€ __pycache__/
โ”‚   โ””โ”€โ”€ main.py                        # Optional script for centralized app execution
โ”‚
โ”œโ”€โ”€ core/                              # Chat logic and shared application functionality
โ”‚   โ”œโ”€โ”€ __pycache__/
โ”‚   โ””โ”€โ”€ chat_engine.py                 # Core engine handling conversations and message flow
โ”‚
โ”œโ”€โ”€ data/                              # Datasets and documents used in KG construction
โ”‚   โ”œโ”€โ”€ clean_text/                    # Cleaned versions of raw text documents
โ”‚   โ”œโ”€โ”€ graph/                         # Serialized Knowledge Graphs
โ”‚   โ”‚   โ””โ”€โ”€ knowledge_graph.pkl        # Pickled NetworkX graph
โ”‚   โ”œโ”€โ”€ html/                          # Raw HTML files from scraped pages
โ”‚   โ”œโ”€โ”€ mosdac_docs/                   # Original documents (pdf/docx) from MOSDAC
โ”‚   โ”œโ”€โ”€ mosdac_pages/                  # Full saved MOSDAC HTML pages
โ”‚   โ””โ”€โ”€ raw_docs/                      # Raw document input before cleaning
โ”‚
โ”œโ”€โ”€ raw_text/                          # Preprocessed plain text documents
โ”‚   โ”œโ”€โ”€ raw_docs                       # Raw text files for reference
โ”‚   โ””โ”€โ”€ test.text                      # Sample text used for testing
โ”‚
โ”œโ”€โ”€ evaluation/                        # Evaluation scripts and outputs
โ”‚   โ”œโ”€โ”€ eval_engine.py                 # Script for evaluating intent/entity/response performance
โ”‚   โ””โ”€โ”€ results/                       # Output metrics and evaluation results
โ”‚       โ”œโ”€โ”€ intent_results.json        # JSON containing evaluation result details
โ”‚       โ”œโ”€โ”€ false_positives.csv        # Queries where intent classification failed
โ”‚       โ””โ”€โ”€ eval_summary.png           # Bar chart visualization of evaluation metrics
โ”‚
โ”œโ”€โ”€ ingestion/                         # Document parsing and scraping modules
โ”‚   โ”œโ”€โ”€ docx_extractor.py              # Parse and extract text from .docx
โ”‚   โ”œโ”€โ”€ dynamic_scraper.py             # Scrape JavaScript-rendered MOSDAC pages
โ”‚   โ”œโ”€โ”€ html_scraper.py                # Parse static HTML files
โ”‚   โ””โ”€โ”€ pdf_extractor.py               # Extract content from PDFs
โ”‚
โ”œโ”€โ”€ intent_classifier/                # Intent classification model and routing
โ”‚   โ”œโ”€โ”€ __pycache__/
โ”‚   โ”œโ”€โ”€ __init__.py                    # Package initializer
โ”‚   โ”œโ”€โ”€ intent_predictor.py            # ML model that predicts user intent
โ”‚   โ””โ”€โ”€ intent_router.py               # Maps intent labels to downstream task handlers
โ”‚
โ”œโ”€โ”€ isro_helpbot/                      # Core pip-installable CLI module
โ”‚   โ”œโ”€โ”€ __pycache__/
โ”‚   โ”œโ”€โ”€ __init__.py                    # Package initializer
โ”‚   โ””โ”€โ”€ cli.py                         # CLI script to launch the bot via terminal
โ”‚
โ”œโ”€โ”€ kg_builder/                        # Knowledge Graph construction modules
โ”‚   โ”œโ”€โ”€ entity_extractor.py            # Extracts named entities from documents/queries
โ”‚   โ”œโ”€โ”€ relationship_mapper.py         # Detects relationships among entities
โ”‚   โ”œโ”€โ”€ response_generator.py          # Forms responses from entities and graph traversal
โ”‚   โ””โ”€โ”€ text_preprocessor.py           # Cleans, splits and processes raw text
โ”‚
โ”œโ”€โ”€ lib/                               # External shared libraries (if any)
โ”‚
โ”œโ”€โ”€ model/                             # Models and vector storage
โ”‚   โ”œโ”€โ”€ __pycache__/
โ”‚   โ”œโ”€โ”€ embedding_generator.py         # Generates embeddings from textual input
โ”‚   โ”œโ”€โ”€ faiss_store_docs.pkl           # Serialized FAISS-compatible document store
โ”‚   โ”œโ”€โ”€ faiss_store.index              # FAISS binary index for fast semantic retrieval
โ”‚   โ”œโ”€โ”€ kg_reasoner.py                 # Reasoning logic using KG + LLM
โ”‚   โ”œโ”€โ”€ language_model.py              # Wrapper for local or API-based language models
โ”‚   โ”œโ”€โ”€ qa_pipeline.py                 # Complete pipeline from query to answer
โ”‚   โ””โ”€โ”€ vector_store.py                # Vector DB abstraction for FAISS, Chroma, etc.
โ”‚
โ”œโ”€โ”€ tests/                             # Unit and integration test scripts
โ”‚   โ”œโ”€โ”€ test_intent_classifier.py      # Tests for intent classification logic
โ”‚   โ”œโ”€โ”€ test_kg.py                     # Tests for KG extraction and structure
โ”‚   โ””โ”€โ”€ test_scrapper.py               # Tests for scraping functions
โ”‚
โ”œโ”€โ”€ ui/                                # Streamlit-based frontend
โ”‚   โ”œโ”€โ”€ __pycache__/
โ”‚   โ”œโ”€โ”€ components/                    # Streamlit component scripts (widgets, etc.)
โ”‚   โ”œโ”€โ”€ static/                        # Static images, graphs, etc.
โ”‚   โ”œโ”€โ”€ templates/                     # HTML templates (optional for hybrid UI)
โ”‚   โ”œโ”€โ”€ index.html                     # Frontend base page
โ”‚   โ”œโ”€โ”€ __init__.py                    # Marks UI as a package
โ”‚   โ””โ”€โ”€ streamlit_app.py               # Streamlit chatbot UI interface
โ”‚
โ”œโ”€โ”€ venv/                              # Python virtual environment (excluded from Git)
โ”œโ”€โ”€ .env                               # API keys and environment variables
โ”œโ”€โ”€ .gitignore                         # Exclude rules for Git
โ”œโ”€โ”€ build_index.py                     # Builds FAISS index for semantic search
โ”œโ”€โ”€ config.py                          # Centralized configuration file (e.g., paths, thresholds)
โ”œโ”€โ”€ entrypoints.py                     # Unified entrypoints for CLI/API/Streamlit
โ”œโ”€โ”€ LICENSE                            # License file (MIT in this case)
โ”œโ”€โ”€ main.py                            # Optional main runner script
โ”œโ”€โ”€ MANIFEST.in                        # Include non-Python files during packaging
โ”œโ”€โ”€ mosdac_crawler.py                  # Crawler script to fetch data from MOSDAC
โ”œโ”€โ”€ pyproject.toml                     # Modern Python packaging metadata
โ”œโ”€โ”€ requirements.txt                   # Required dependencies for pip install
โ””โ”€โ”€ setup.py                           # Package installer configuration

Let me know if you want this as a downloadable .md or .txt file or integrated into your README.md.


---

## โš™๏ธ Installation

```bash
pip install isro-helpbot

Or clone and run locally:

git clone https://github.com/Gaurav9693089415/ISRO-HelpBot.git
cd ISRO-HelpBot
pip install -e .

๐Ÿš€ Usage

๐Ÿ“ Launch Chatbot UI

isro-helpbot

This opens the Streamlit interface at http://localhost:8501/.

๐Ÿ“ Run Backend API

uvicorn backend.main:app --reload --port 8080

๐Ÿ“Š Evaluation Metrics

Evaluation metrics like accuracy, precision, recall, and response latency are automatically logged and can be viewed in the Streamlit sidebar.


๐Ÿ“‚ Supported Document Types

  • .txt โ€“ Plain text files
  • .pdf โ€“ Scanned and digital PDFs
  • .docx โ€“ Microsoft Word
  • .xlsx โ€“ Excel Sheets

Uploaded files auto-update the Knowledge Graph.


๐Ÿ’ป Technologies Used

Category Tools/Tech Stack
NLP spaCy, NLTK, SentenceTransformers
KG + Search NetworkX, FAISS, PyVis
UI Streamlit
Backend FastAPI, Uvicorn
Others LangChain, OpenAI API, Selenium

๐ŸŽฏ Objectives (As per ISRO Hackathon)

  • Convert web portal content into machine-readable knowledge.
  • Enable geospatial semantic search.
  • Build a dynamic, AI-based helpbot interface.
  • Provide API for external access to the system.

๐Ÿ Final Outcome

An end-to-end, modular AI HelpBot that:

  • Parses ISRO content into a Knowledge Graph.
  • Understands user questions contextually.
  • Answers using accurate and semantically relevant data.
  • Offers CLI + UI + REST API + pip packaging.

๐Ÿ›ก๏ธ License

MIT License. See LICENSE file.


๐Ÿ™Œ Acknowledgement

Special thanks to ISRO, IN-SPACe, and AICTE for organizing the Bharatiya Antariksh Hackathon 2025.


โœจ Future Enhancements

  • Voice interaction
  • Image-based QnA using satellite maps
  • Integration with live ISRO data streams

---

Let me know if you'd like me to:
- Add badges (PyPI, License, Build)
- Generate this as a downloadable file
- Translate it into Hindi (for local repo presentation)

Ready to proceed with packaging now?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

isro_helpbot-1.0.0.tar.gz (17.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

isro_helpbot-1.0.0-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file isro_helpbot-1.0.0.tar.gz.

File metadata

  • Download URL: isro_helpbot-1.0.0.tar.gz
  • Upload date:
  • Size: 17.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for isro_helpbot-1.0.0.tar.gz
Algorithm Hash digest
SHA256 599c25da5fd8edf8689c7305b241eb3ffc9df0e8f8f17951b6dcdd1b184caf63
MD5 757b1ff09685838d74b7be3ddfeee125
BLAKE2b-256 76897855d862a0f744f51410d006009e59aa605f85fb6c847b7f1cf68e373b95

See more details on using hashes here.

File details

Details for the file isro_helpbot-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: isro_helpbot-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for isro_helpbot-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e46a40908d0f48dd5020b8f66aed1190da5eb7d2f76bfdcce24a6fb4651363c3
MD5 f746323cd0a3cd95d3d19e8e9f1b018b
BLAKE2b-256 b7a6ae16ce7a698eab4608bec6ce283094932de2ee40d3cb081e8dab9ca506aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page