Skip to content

Praharsh7270/Mentor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ AI-Powered Mentorship Platform

An intelligent Django-based mentorship platform that connects students with mentors, featuring AI-powered answer generation and multi-language translation capabilities.

🌟 Features

πŸ€– AI-Powered Features

  • AI Answer Generation: Mentors can generate detailed, comprehensive answers using a pre-trained Qwen language model
  • Smart Translation: Real-time translation of questions and answers in multiple languages (English, Chinese, Japanese, Hindi)
  • AI Answer Enhancement: Mentors can improve their responses using AI assistance

πŸ‘¨β€πŸŽ“ Student Dashboard

  • Question Management: Post questions with categories (Programming, Career, Project Help, General Learning)
  • Real-time Updates: View mentor responses as they arrive
  • Multi-language Support: Translate questions and answers to preferred languages
  • Progress Tracking: Monitor question status (Pending, Answered, Closed)

πŸ‘¨β€πŸ« Mentor Dashboard

  • Question Overview: View all student questions with filtering options
  • AI-Assisted Responses: Generate or enhance answers using AI
  • Translation Tools: Communicate effectively across language barriers
  • Student Analytics: Track mentoring activities and statistics

πŸ”§ Technical Features

  • Django Framework: Modern web framework with robust security
  • User Authentication: Role-based access (Student/Mentor)
  • Database Persistence: SQLite database for storing questions, answers, and user data
  • Responsive Design: Bootstrap for mobile-friendly interface
  • AJAX Operations: Seamless user experience without page reloads

πŸ—οΈ Project Structure

mentor/
β”œβ”€β”€ web/                          # Django project root
β”‚   β”œβ”€β”€ manage.py                 # Django management script
β”‚   β”œβ”€β”€ requirements.txt          # Python dependencies
β”‚   β”œβ”€β”€ db.sqlite3               # SQLite database
β”‚   β”œβ”€β”€ projectname/             # Django project settings
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ settings.py          # Django configuration
β”‚   β”‚   β”œβ”€β”€ urls.py              # URL routing
β”‚   β”‚   β”œβ”€β”€ wsgi.py              # WSGI configuration
β”‚   β”‚   └── asgi.py              # ASGI configuration
β”‚   β”œβ”€β”€ auth/                    # Authentication app
β”‚   β”‚   β”œβ”€β”€ models.py            # Database models (User, Question, Answer)
β”‚   β”‚   β”œβ”€β”€ views.py             # View controllers and AI integration
β”‚   β”‚   β”œβ”€β”€ admin.py             # Django admin configuration
β”‚   β”‚   β”œβ”€β”€ apps.py              # App configuration
β”‚   β”‚   β”œβ”€β”€ templates/           # HTML templates
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.html       # Login page
β”‚   β”‚   β”‚   β”œβ”€β”€ Register.html    # Registration page
β”‚   β”‚   β”‚   β”œβ”€β”€ Student.html     # Student dashboard
β”‚   β”‚   β”‚   └── Mentor.html      # Mentor dashboard
β”‚   β”‚   β”œβ”€β”€ templatetags/        # Custom template filters
β”‚   β”‚   β”‚   └── mentor_filters.py
β”‚   β”‚   └── migrations/          # Database migrations
β”‚   └── home/                    # Home app
β”‚       β”œβ”€β”€ models.py
β”‚       β”œβ”€β”€ views.py
β”‚       β”œβ”€β”€ admin.py
β”‚       β”œβ”€β”€ Templates/           # Home app templates
β”‚       β”‚   β”œβ”€β”€ Base.html        # Base template
β”‚       β”‚   β”œβ”€β”€ Home.html        # Landing page
β”‚       β”‚   └── About.html       # About page
β”‚       └── migrations/
β”œβ”€β”€ saved_qwen_model/            # Pre-trained AI model (config files only)
β”‚   β”œβ”€β”€ config.json              # Model configuration
β”‚   β”œβ”€β”€ tokenizer.json           # Tokenizer configuration
β”‚   β”œβ”€β”€ vocab.json               # Vocabulary
β”‚   └── ...                      # Other model config files
β”œβ”€β”€ translate.ipynb              # Translation development notebook
β”œβ”€β”€ Untitled.ipynb              # Additional notebooks
β”œβ”€β”€ output_audio.mp3             # Audio file
└── README.md                    # Project documentation

β”œβ”€β”€ translate.ipynb # Translation development notebook β”œβ”€β”€ anaconda_projects/ # Anaconda project files └── README.md # Project documentation


## πŸš€ Installation & Setup

### Prerequisites
- Python 3.8+
- Django 5.2
- PyTorch
- Transformers library

### 1. Clone the Repository
```bash
git clone https://github.com/Praharsh7270/Mentor.git
cd Mentor

2. Create Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install Dependencies

cd web
pip install -r requirements.txt

4. Model Setup

Important Note: The large AI model file (model.safetensors) is not included in the repository due to GitHub's file size limitations. You will need to:

  1. Download the Qwen model separately from Hugging Face or another source
  2. Place the model.safetensors file in the saved_qwen_model/ directory
  3. Ensure all model configuration files are present

Alternatively, you can modify the code to use a different model or implement a different AI solution.

5. Database Setup

python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser  # Create admin account

6. Run the Server

python manage.py runserver

Visit http://127.0.0.1:8000 to access the platform.

🎯 Usage Guide

For Students

  1. Register/Login as a student
  2. Post Questions:
    • Write clear question titles and descriptions
    • Select appropriate categories
    • Use translation features if needed
  3. View Answers:
    • Monitor your dashboard for mentor responses
    • Translate answers to your preferred language
    • Track question status

For Mentors

  1. Register/Login as a mentor
  2. Browse Questions:
    • View all student questions
    • Filter by status and category
    • Use translation tools to understand questions in different languages
  3. Provide Answers:
    • Write comprehensive responses
    • Use "Answer with AI" for AI-generated responses
    • Use "AI Assist" to enhance your existing answers
    • Submit answers with real-time updates

πŸ€– AI Integration

Qwen Language Model

The platform integrates a pre-trained Qwen model for:

  • Generating detailed mentor responses
  • Enhancing existing answers
  • Providing context-aware suggestions

Translation Service

  • Multi-language support: English, Chinese (δΈ­ζ–‡), Japanese (ζ—₯本θͺž), Hindi (ΰ€Ήΰ€Ώΰ€‚ΰ€¦ΰ₯€)
  • Real-time translation of questions and answers
  • Context preservation during translation

πŸ“Š Database Schema

Models

  • UserProfile: Extends Django User with role-based access
  • Question: Student questions with categories and status tracking
  • Answer: Mentor responses linked to questions

Relationships

  • One-to-Many: User β†’ Questions
  • One-to-Many: User β†’ Answers
  • One-to-Many: Question β†’ Answers

πŸ› οΈ Technology Stack

Backend

  • Django: Web framework
  • SQLite: Database
  • PyTorch: AI model framework (if using local model)
  • Transformers: Hugging Face library

Frontend

  • Bootstrap: CSS framework
  • JavaScript ES6: Dynamic interactions
  • AJAX: Asynchronous operations

AI/ML

  • Qwen Model: Language model for answer generation (model file not included)
  • Custom Translation API: Multi-language support

πŸ”§ Configuration

Environment Variables

Create a .env file in the web directory:

SECRET_KEY=your_secret_key_here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1

AI Model Configuration

The Qwen model configuration files are in saved_qwen_model/. The large model file (model.safetensors) needs to be downloaded separately due to size constraints.

πŸš€ Deployment

Production Setup

  1. Set DEBUG=False in settings
  2. Configure proper database (PostgreSQL recommended)
  3. Set up static file serving
  4. Configure ALLOWED_HOSTS
  5. Use environment variables for sensitive data

Docker Deployment (Optional)

# Dockerfile example
FROM python:3.9
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Praharsh7270

πŸ™ Acknowledgments

  • Hugging Face for the Transformers library
  • Qwen model developers
  • Django community
  • Bootstrap team for the UI framework

πŸ“ž Support

If you encounter any issues or have questions:

  1. Check the Issues section
  2. Create a new issue with detailed information
  3. Contact the maintainer

⚠️ Important Notes

  • Large Model File: The model.safetensors file (3.1GB) is not included in this repository due to GitHub's file size limitations
  • Model Setup: You'll need to download the Qwen model separately or configure an alternative AI solution
  • Dependencies: Ensure all Python dependencies are installed as specified in requirements.txt

⭐ Star this repository if you find it helpful! ⭐

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published