https://github.com/PrintNow/langdetect-api
473
GitHub 项目地址:https://github.com/PrintNow/langdetect-api
Dockerfile使用方法:
docker run -d \
--name langdect-api \
-p 8899:8899/tcp \
--restart always \
shine09/langdetect-api
自定义端口号、进程数量:
-e NUM_PROCESSES=200 表示运行 200 个进程,默认 4 个进程-e LISTEN_PORT=8866 表示监听 8866 端口,默认监听 8899 端口docker run -d \
--name langdect-api \
-e NUM_PROCESSES=200 \
-e LISTEN_PORT=8866 \
-p 8866:8866/tcp \
--restart always \
shine09/langdetect-api
POST http://127.0.0.1:8899
body:
[
"你好,世界",
"Returns the best results.",
"You can specify the number of records to return. For example the following code will return the top three entries.",
"Returns the result as an array."
]
result:
{
"code": 200,
"msg": "ok",
"data": [
{
"text": "你好,世界",
"language": "zh-cn"
},
{
"text": "Returns the best results.",
"language": "en"
},
{
"text": "You can specify the number of records to return. For example the following code will return the top three entries.",
"language": "en"
},
{
"text": "Returns the result as an array.",
"language": "en"
}
]
}
cURL 命令运行:
curl --location --request POST 'http://127.0.0.1:8899' \
--header 'Content-Type: application/json' \
--data-raw '[
"你好,世界",
"Returns the best results.",
"You can specify the number of records to return. For example the following code will return the top three entries.",
"Returns the result as an array."
]'
识别会不太准确
Content type
Image
Digest
sha256:fbfb5abbb…
Size
31.8 MB
Last updated
over 3 years ago
docker pull shine09/langdetect-api