This example demonstrates how to use the NeMo to perform ASR (Automatic Speech Recognition) in Label Studio.
Use this model if you want to transcribe and fix your audio data.
Before you begin, you must install the Label Studio ML backend.
This tutorial uses the nemo_asr
example.
This example works with the Label Studio's pre-built Audio Transcription template (available under Audio Processing > Audio Transcription).
<View>
<Audio name="audio" value="$audio" zoom="true" hotkey="ctrl+enter" />
<Header value="Provide Transcription" />
<TextArea name="transcription" toName="audio"
rows="4" editable="true" maxSubmissions="1" />
</View>
But you can use any other labeling interface that combines <Audio>
and <TextArea>
elements.
Warning: If you use files hosted in Label Studio (meaning they were added using the import action), hosted in cloud storage, or connected through local storage, then you must provide the
LABEL_STUDIO_URL
andLABEL_STUDIO_API_KEY
environment variables to the ML backend. For more information, see Allow the ML backend to access Label Studio data. For information about finding your Label Studio API key, see Access token.
- Start the Machine Learning backend on
http://localhost:9090
with the prebuilt image:
docker-compose up
- Validate that backend is running:
$ curl http://localhost:9090/
{"status":"UP"}
- Create a project in Label Studio. Then from the Model page in the project settings, connect the model. The default URL is
http://localhost:9090
.
To build the ML backend from source, you have to clone the repository and build the Docker image:
docker-compose build
To run the ML backend without Docker, you have to clone the repository and install all dependencies using pip:
python -m venv ml-backend
source ml-backend/bin/activate
pip install -r requirements.txt
Then you can start the ML backend:
label-studio-ml start ./nemo_asr
Parameters can be set in docker-compose.yml
before running the container.
The following common parameters are available:
MODEL_NAME
- Specify the model name for the ASR. (QuartzNet15x5Base-En
by default)BASIC_AUTH_USER
- Specify the basic auth user for the model serverBASIC_AUTH_PASS
- Specify the basic auth password for the model serverLOG_LEVEL
- Set the log level for the model serverWORKERS
- Specify the number of workers for the model serverTHREADS
- Specify the number of threads for the model serverLABEL_STUDIO_HOST
: The host of the Label Studio instance. Default ishttp://localhost:8080
.LABEL_STUDIO_API_KEY
: The API key for the Label Studio instance.
The ML backend can be customized by adding your own models and logic inside ./nemo_asr/model.py
.