This project is designed to simplify the retrieval of the content in the Constitution of Kenya through a user-friendly chatbot interface
# Kenya Constitution Chatbot Project
## Overview
The Kenya Constitution Analysis Project is a Jupyter Notebook-based application designed to extract, process, and analyze the text of the Kenya Constitution from a PDF file. This project leverages natural language processing (NLP) techniques to enable users to query specific sections of the constitution, making it a valuable tool for legal studies, civic education, and research.
## Features
- **PDF Text Extraction**: Extracts text from specified pages of the Kenya Constitution PDF using `pdfplumber`.
- **Text Processing**: Organizes the extracted text into structured chapters and sections for easy access.
- **Natural Language Processing**: Utilizes `spaCy` for preprocessing user queries, including lemmatization and stopword removal.
- **Question Answering System**: Allows users to ask questions related to specific sections of the constitution and receive relevant answers.
- **Synonym Mapping**: Enhances query recognition by mapping synonyms to key terms in the constitution.
## Installation
To run this project, you need to have Python installed on your machine. Follow these steps to set up the environment:
1. **Clone the repository**:
```bash
git clone
github.com
cd kenya-constitution-analysis
```
2. **Install the required libraries**:
You can install the necessary libraries using pip. Run the following command:
```bash
pip install spacy pdfplumber pyspellchecker
```
3. **Download the spaCy model**:
You will also need to download the English language model for spaCy:
```bash
python -m spacy download en_core_web_sm
```
4. **Add the Kenya Constitution PDF**:
Place the Kenya Constitution PDF file in the project directory and update the file path in the notebook accordingly.
## Usage
1. Open the Jupyter Notebook in your preferred environment (e.g., Jupyter Lab, Jupyter Notebook).
2. Run the cells sequentially to extract and process the text from the Kenya Constit …