LinTO-platform-diarization is the LinTO service for speaker diarization.
LinTO-platform-diarization can either be used as a standalone diarization service or deployed as a micro-services.
Prerequisites
Deploy
Usage
License
The transcription service requires docker up and running.
The diarization only entry point in job mode are tasks posted on a Redis message broker. Futhermore, to prevent large audio from transiting through the message broker, diarization uses a shared storage folder mounted on /opt/audio.
linto-platform-diarization can be deployed:
1- First step is to build the image:
bashgit clone https://github.com/linto-ai/linto-platform-diarization.git cd linto-platform-diarization docker build . -t linto-platform-diarization:latest
1- Fill the .env
bashcp .env_default_http .env
Fill the .env with your values.
Parameters:
| Variables | Description | Example |
|---|---|---|
| SERVING_MODE | Specify launch mode | http |
| CONCURRENCY | Number of HTTP worker* | 1+ |
2- Run the container
bashdocker run --rm \ -v SHARED_FOLDER:/opt/audio \ -p HOST_SERVING_PORT:80 \ --env-file .env \ linto-platform-diarization:latest
This will run a container providing an http API binded on the host HOST_SERVING_PORT port.
Parameters:
| Variables | Description | Example |
|---|---|---|
| HOST_SERVING_PORT | Host serving port | 80 |
*diarization uses all CPU available, adding workers will share the available CPU thus decreasing processing speed for concurrent requests
LinTO-platform-diarization can be deployed as a micro-service using celery. Used this way, the container spawn celery worker waiting for diarization task on a message broker.
You need a message broker up and running at SERVICES_BROKER.
1- Fill the .env
bashcp .env_default_task .env
Fill the .env with your values.
Parameters:
| Variables | Description | Example |
|---|---|---|
| SERVING_MODE | Specify launch mode | task |
| SERVICES_BROKER | Service broker uri | redis://my_redis_broker:6379 |
| BROKER_PASS | Service broker password (Leave empty if there is no password) | my_password |
| QUEUE_NAME | (Optionnal) overide the generated queue's name (See Queue name bellow) | my_queue |
| SERVICE_NAME | Service's name | diarization-ml |
| LANGUAGE | Language code as a BCP-47 code | en-US or * or languages separated by "|" |
| MODEL_INFO | Human readable description of the model | Multilingual diarization model |
| CONCURRENCY | Number of worker (1 worker = 1 cpu) | >1 |
2- Fill the docker-compose.yml
#docker-compose.yml
yamlversion: '3.7' services: punctuation-service: image: linto-platform-diarization:latest volumes: - /path/to/shared/folder:/opt/audio env_file: .env deploy: replicas: 1 networks: - your-net networks: your-net: external: true
3- Run with docker compose
bashdocker stack deploy --resolve-image always --compose-file docker-compose.yml your_stack
Queue name:
By default the service queue name is generated using SERVICE_NAME and LANGUAGE: diarization_{LANGUAGE}_{SERVICE_NAME}.
The queue name can be overided using the QUEUE_NAME env variable.
Service discovery:
As a micro-service, the instance will register itself in the service registry for discovery. The service information are stored as a JSON object in redis's db0 under the id service:{HOST_NAME}.
The following information are registered:
json{ "service_name": $SERVICE_NAME, "host_name": $HOST_NAME, "service_type": "diarization", "service_language": $LANGUAGE, "queue_name": $QUEUE_NAME, "version": "1.2.0", # This repository's version "info": "Multilingual diarization model", "last_alive": 65478213, "concurrency": 1 }
/healthcheck
Returns the state of the API
Method: GET
Returns "1" if healthcheck passes.
/diarization
Diarization API
Return a json object when using structured as followed:
json{ "speakers": [ {"spk_id": "spk5", "duration": 2.0, "nbr_seg": 1}, ... ], "segments": [ {"seg_id": 1, "spk_id": "spk5", "seg_begin": 0.0, "seg_end": 2.0}, ... ] }
/docs
The /docs route offers a OpenAPI/swagger interface.
STT-Worker accepts requests with the following arguments:
file_path: str, speaker_count: int (None), max_speaker: int (None)
Return format
On a successfull transcription the returned object is a json object structured as follow:
json{ "speakers": [ {"spk_id": "spk5", "duration": 2.0, "nbr_seg": 1}, ... ], "segments": [ {"seg_id": 1, "spk_id": "spk5", "seg_begin": 0.0, "seg_end": 2.0}, ... ] }
You can test you http API using curl:
bashcurl -X POST "http://YOUR_SERVICE:PORT/diarization" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@YOUR_FILE.wav;type=audio/x-wav" -F "spk_number=NUMBER_OF_SPEAKERS"
This project is developped under the AGPLv3 License (see LICENSE).
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务