This project is a multilingual blog application built with Django. It features AI-powered search and chatbot functionalities using the Hugging Face transformers library. The application is designed to support multiple languages including English, French, Spanish, and German.
- Multilingual Support: Supports English, French, Spanish, and German.
- AI-Powered Search: Enhanced search functionality using Hugging Face's transformers for relevant article retrieval.
- AI Chatbot: A chatbot that provides answers based on a predefined knowledge base and dynamic responses.
- Article Management: Add, view, and delete articles.
- Python 3.8+
- Django 3.2.25
- Git
git clone https://github.com/light624/multilingual_project.git
cd multilingual_project
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
-
Navigate to Add Article Page:
- URL:
http://127.0.0.1:8000/add_article/
- URL:
-
Fill in the Form:
- Title
- Content
-
Submit:
- Click the "Save" button.
-
Navigate to Search Page:
- URL:
http://127.0.0.1:8000/search/
- URL:
-
Enter Search Query:
- Enter the keyword or question in the search bar.
-
View Results:
- Relevant articles will be displayed along with their relevance score.
-
Navigate to Chatbot Page:
- URL:
http://127.0.0.1:8000/chatbot/
- URL:
-
Enter Question:
- Type your question in the input field.
-
View Response:
- The chatbot will provide an answer based on the knowledge base or dynamic response.
- Create a New Web Service on Render.com
- Connect to Your GitHub Repository
- Configure Environment:
- Set the build command:
pip install -r requirements.txt
- Set the start command:
gunicorn multilingual_project.wsgi:application
- Set the build command:
- Add Environment Variables:
DJANGO_SECRET_KEY
: Your Django secret key.DATABASE_URL
: Your database URL.
- Deploy: Render.com will automatically deploy your application. -My_url :"https://multilingual-project.onrender.com"
-
ModuleNotFoundError: No module named 'nltk'
- Ensure
nltk
is listed inrequirements.txt
. - Run
pip install nltk
.
- Ensure
-
RuntimeError: At least one of TensorFlow 2.0 or PyTorch should be installed
- Ensure
torch
is listed inrequirements.txt
. - Run
pip install torch
.
- Ensure
-
Out of Memory Error
- Consider upgrading your Render.com instance.
- Use Hugging Face's hosted inference API instead of running models locally.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/feature-name
). - Commit your changes (
git commit -am 'Add some feature'
). - Push to the branch (
git push origin feature/feature-name
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
This README.md
provides a comprehensive guide to setting up, using, and deploying your multilingual blog application with AI-powered search and chatbot functionalities.