Skip to content

Real-time background subtraction using OpenCV + Flask with switchable detection algorithms and stylish frontend

License

Notifications You must be signed in to change notification settings

Aayushinit/LanguageDetectorApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌐 Language Detector Web App

Detect the language of any text input instantly using Python, Flask, and LangDetect. Tracks detection history with a clean web UI and smart caching.


## 📖 Overview

Language Detector is a full-stack Flask web application that uses the langdetect library to detect the language of any given text. It includes:

  • 🧠 Automatic Language Detection using langdetect
  • 💾 Detection History Tracking with SQLite (via SQLAlchemy)
  • Smart Caching for faster repeat detection
  • 🖥️ Responsive Web Interface with recent detection previews

Built for fast prototyping, linguistic demos, and simple multi-language handling.


⚙️ Features

🧠 Instant Language Detection

  • Uses langdetect to identify the language code (e.g., en, fr, de, hi)
  • Shows both code and full language name using pycountry

💾 Recent Detection History

  • Displays last 5 detections on home page
  • View complete paginated history on /history page

🚀 Fast Caching

  • Avoids repeated detection for same text using a TTL-based cache (5 minutes default)

🖥️ Clean Web Interface

  • Built with HTML/CSS and modular templates (using Jinja2)
  • Includes 404 and 500 error pages

🛠️ Technologies Used

Category Tech Stack
Backend Flask (Python)
Language Detection langdetect, pycountry
Database SQLite + SQLAlchemy
Frontend HTML, CSS (custom), JS
Caching TTL-based manual Python decorator


🔌 Flask Endpoints

Route Description
/ Home page with text input + recent detections
/detect API endpoint for POST-based language detection
/history Full history page with pagination

🚀 Getting Started

  1. Clone the Repository
git clone https://github.com/Aayushinit/LanguageDetectorApp.git
cd LanguageDetectorApp
  1. Install Dependencies
pip install flask langdetect pycountry flask_sqlalchemy
  1. Run the App
python app.py
  1. Visit in Browser http://localhost:5000

💡 How It Works

  • Accepts user text input from the frontend
  • langdetect attempts to detect language code
  • pycountry maps language code to human-readable name
  • Result is cached and also saved in the database
  • History is displayed and paginated with timestamps

🔮 Future Improvements

  • 🔤 Display detection confidence (if supported)
  • 🌍 Add language flag icons
  • 💬 Translate detected text
  • 💽 Export detection history as CSV
  • 📱 Mobile-optimized interface with Tailwind CSS

👨‍💻 Author

Aayush Kadam — Final Year AI & ML Student | Python & Web Enthusiast

"Giving apps the power to understand language—one line at a time."

LinkedIn · GitHub


⭐️ Show Your Support

If you find this project helpful, please ⭐ the repo and share with your network!


📜 License

Licensed under the MIT License.

UI and logic were developed for educational and demonstration purposes.

Releases

No releases published

Packages

No packages published