Debian update, big model, 3 predictions

This commit is contained in:
SuspiciousActivity committed 2026-09-18 19:52:18 +02:00
1 parent c99bfc0a37
commit 5dbfba9a84
5 files changed
+44 -17

No files matched your search

+22 -8
View File
@@ -1,3 +1,7 @@
## This is a fork
Forked from [badlogic/fasttext-lid-server](https://github.com/badlogic/fasttext-lid-server/), this repository uses a newer debian version (bookworm), uses the [bigger model](https://fasttext.cc/docs/en/language-identification) (126MB) and gives you the top 3 results instead of only 1.
# FastText Language ID Server
HTTP server that provides language identification using FastText models.
@@ -6,7 +10,7 @@ HTTP server that provides language identification using FastText models.
```bash
# Pull and run
docker run -p 8080:8080 mariozechner/fasttext-lid-server
docker run -p 8080:8080 suspiciousactivity/fasttext-lid-server
# Test
curl "http://localhost:8080/detect?text=Hello%20world"
@@ -18,10 +22,20 @@ curl "http://localhost:8080/detect?text=Hello%20world"
- **Parameter**: `text` (required)
- **Response**: JSON with language code and probability
```json
{
"language": "en",
"probability": 0.987
}
[
{
"language": "en",
"probability": 0.987
},
{
"language": "de",
"probability": 0.234
},
{
"language": "nl",
"probability": 0.123
}
]
```
- **Errors**:
- 400: Missing text parameter
@@ -32,14 +46,14 @@ curl "http://localhost:8080/detect?text=Hello%20world"
### Using docker run
```bash
# Default settings
docker run -p 8080:8080 mariozechner/fasttext-lid-server
docker run -p 8080:8080 suspiciousactivity/fasttext-lid-server
# Custom settings
docker run -p 9000:9000 \
-e PORT=9000 \
-e MODEL_FILE=/models/custom.ftz \
-v $(pwd)/models:/models \
mariozechner/fasttext-lid-server
suspiciousactivity/fasttext-lid-server
```
### Using docker compose
@@ -48,7 +62,7 @@ version: '3.8'
services:
lid-server:
image: mariozechner/fasttext-lid-server
image: suspiciousactivity/fasttext-lid-server
ports:
- "${PORT:-8080}:${PORT:-8080}"
environment: