MinerlexAI simplifies understanding Mining Laws using AI. It combines Google Gemini for legal Q&A, MBart for translation, and gTTS for voice output — offering support in multiple Indian languages.
- 🧠 AI Legal Assistant: Uses Google Gemini to answer mining law queries accurately.
- 🌍 Multilingual Support: Translates answers into 12+ Indian languages via MBart50.
- 🔊 Text-to-Speech: Converts text responses into audio using gTTS.
- 🎙️ Voice Interaction: Allows users to ask questions using a microphone.
- 📄 PDF Ready: UI supports PDF uploads (backend coming soon).
- 💡 Interactive UI: Built with Streamlit for a smooth user experience.
Tool / Library | Purpose |
---|---|
Streamlit | Interactive Web UI |
Google Gemini (google.generativeai ) |
Core Q&A Generation |
MBart50 (HuggingFace Transformers) | Neural Machine Translation |
gTTS (Google Text-to-Speech) | Speech Synthesis |
SpeechRecognition | Voice Input Processing |
python-dotenv | Environment Variables Management |
PyTorch | ML Backend for MBart |
graph TD
A["🗣️ User Input (Text/Voice)"] --> B["🖥️ Streamlit Interface"]
subgraph "Input Processing"
B -- "If Voice" --> C["🎤 Speech Recognition"]
C --> D["📝 Query Text"]
B -- "If Text" --> D
end
subgraph "Core Logic"
D --> E["🧠 Google Gemini API"]
E --> F["📜 Raw Response"]
end
subgraph "Output Processing"
F --> G{"🔄 Translate?"}
G -- "Yes" --> H["🌍 MBart Translation"]
H --> I["✅ Final Text"]
G -- "No (English)" --> I
I --> J["📄 Display Text in UI"]
I --> K{"🔊 Generate Audio?"}
K -- "Yes" --> L["🗣️ gTTS"]
L --> M["🎶 Play Audio in UI"]
end
git clone https://github.com/yourusername/minerlexai.git
cd minerlexai
# Create virtual environment
python -m venv venv
# Activate environment
# Linux/macOS
source venv/bin/activate
# Windows
venv\Scripts\activate
pip install -r requirements.txt
(Make sure requirements.txt
lists all necessary packages.)
Create a .env
file in the root directory:
# .env file
GEMINI_API_KEY=YOUR_GOOGLE_GEMINI_API_KEY_HERE
streamlit run main.py
Then, visit http://localhost:8501 in your browser.
MinerlexAI supports translation to and from English for the following Indian languages (MBart50 codes):
- Hindi (hi_IN) – हिन्दी
- Bengali (bn_IN) – বাংলা
- Tamil (ta_IN) – தமிழ்
- Telugu (te_IN) – తెలుగు
- Marathi (mr_IN) – मराठी
- Gujarati (gu_IN) – ગુજરાતી
- Malayalam (ml_IN) – മലയാളം
- Kannada (kn_IN) – ಕನ್ನಡ
- Odia (or_IN) – ଓଡ଼ିଆ
- Urdu (ur_PK) – اردو (Note: MBart uses Pakistan locale)
- Assamese (as_IN) – অসমীয়া
- ... and more supported by MBart50
- 🔑 API Key: A valid Google Gemini API key is required. Get one from Google AI Studio.
- 🎤 Microphone: Browser permissions are needed for voice input.
- ⏳ Model Download: MBart50 (~2.4 GB) will be downloaded on first use — please wait.
- 📄 PDF Feature: UI supports PDF uploads, but backend implementation (like parsing and RAG) is pending.
We welcome contributions! To get started:
- Fork the project
- Create a new branch:
git checkout -b feature/AmazingFeature
- Commit your changes:
git commit -m "Add AmazingFeature"
- Push to the branch:
git push origin feature/AmazingFeature
- Open a Pull Request
Feel free to open an issue for discussion!
Distributed under the MIT License. See the LICENSE
file for details.
Built with ❤️ by Mrinal
GitHub Profile