--- title: Language Detection API emoji: 🌐 colorFrom: blue colorTo: green sdk: docker sdk_version: "3.9" app_file: app.py pinned: false --- # Language Detection API This is a FastAPI application that provides language detection capabilities using Facebook's FastText model. ## Features - Language detection for 176 different languages - High accuracy using FastText's pre-trained model (lid.176.bin) - Simple REST API interface - Docker containerized ## API Endpoints ### GET / Health check endpoint that confirms the API is running. ### POST /detect Detects the language of the provided text. Request body: ```json { "text": "Your text here" } ``` Response: ```json { "language": "en", "confidence": 0.976 } ``` ## Technical Details - Built with FastAPI and Python 3.9 - Uses FastText v0.9.2 - Containerized with Docker - Hosted on Hugging Face Spaces