??? AI? ???? ?? ????? ?????? ??? ???? ???? ??? ?? ?? ??? ??? ????? ???? ?? ?????. ??? AI ?? ???? ??? ???? ????, ?? ??? ???? ????, ??? ??? ????, ?? ??? ???? ???? ?????? ??? ??? ? ????.
??? AI ???? ??????? ???? ?? ?????. ????? ??? ?? ??? ?? ??? ?? ?? ?? ??? ???? ?? ?? ???. ????? ???? ??????? ???? ???? ?? ??? ??? ??? ??? ???, ?? ??, ???? ?? ??? ?????.
??? ??? ???? ?? ? ?????? ? ?? ?? ??? ?????.
- ??? AI ??? ??? ?? ??? ???? ?? NVIDIA TAO Toolkit.
- ?? ??? ??? ??? ???? ?? NVIDIA Riva.
- ?? ?? ?? ?? ??? ???? ? ? ?? ?? ??? ??? AI ??? ????NVIDIA NGC ???.
??? ???? ??? ?? ??? 80??? ??, ?? ??, ?? ??? 8???? ??? ? ????. ? ?????? TAO Toolkit? ??? ??, ??? ?? ?? ????? ???? ???, ??? AI ??? ???? ??? ??? ???? ?? Riva? ???? ??? ?????.
??? AI ??
??? AI ????? ?? ??? ?? ? ?? ?? ????? ???? ? ?? ?? ??? ????(?? 1).
- ?? ?? ??(ASR)? ???? ??? ???? ???? ?? ??? ?????. ??? ?? ? ??? ???? ???? ??? ?? ?? ????.
- ??? ??(NLP)? ?? ?? ??, ??, ????? ??? ??? ??? ????. NLP? ??? ???(entity) ??? ?? ??? ???? ?? ?? ??, ?? ??, ?? ??? ?? ??? ???? ?????.
- ??? ?? ?? (TTS)? ??? ??? ??? ??? ???? ?? ? ?? ?? ??? ?????.

?? 1. ??? AI ???? ? ?? ?? ???? ?? ??.
??? ???? ??? ???? ??? ? ???, ?? ???? ???? ?? ??? ??? ???? ?? ??? ?? ?? ???? ??? ???? ??? ??? ??????. ??? ??? ???? ??? ???. ??? ?? ??? ??? ???? ?? ?????.
??? ??? ???? ?? ?? ???? ??? ? ??? ‘?? ??(transfer learning)’??? ??? ???? ????. ?? ??? ?? ???? ? ???? ??(?? ??)? ? ??? ??? ???? ???? ?? ????. ???? ?? ?? ??? ?? ?? ??? ????(x10 ?? ??? ???) ??? ??? ??? ???. ?????, ???? ??? ?? ?????? ??? ???? ? ??? ??? AI ???? ?? ?????.
TAO Toolkit 3.0 ??
TAO Toolkit? ?? ??? ?? ??? ??? ??, ?? ???? ???????? ?? ???(Python) ?????. ? ??? ??? ???? ??? ?? ?? ??? ??? ?????? ????? ?? ???? ? ??? ?? ????.
TAO Toolkit? ?? ??? ??? ??? ?? ?? ????? ???, ??? ?? ??? ???? ? ??? ? ?? ??? ???? ?? ?? ?? ??? ? ?? ??? ????, ?? ??? ?? ????? ????. ??? ??? ?? ?? ??? ? ??? ?? ?? ?? ?? ?? ?? ??? ?? ???? ??? ??? ???? ?? ??? ??? ?? ??? ? ?? ????. ??? TAO Toolkit 3.0 ???? ??, ? ??? ??? ???? ??? ?? ??? ??? AI ??? ???? ??????.

?? 2. ?? ??? ?? ??(?? ??)? ??(?? ??)? ??? TAO Toolkit? ?? ?????.
TAO Toolkit? ?? ??? ?? ??(Docker) ???? ??? ?? ??? ???? ????? ???? ??????. ????? ???? ??? ??? ???? ???? ??? ?? ?? ??? ?????. ??? ? ??? ?? ??? ??, ??, ?? ?? ???? ??? ?? ?????? ??? ??? ??? ???? ?????. ??? ??? ?? ??(subtask)??, ?? ??? ??????? ???(?? 2).
TAO Toolkit? ?????? ? ?? ??? ????? ?????. ? ?????? ?? ??? ?? ??? ??? ?? ??? ??? ????? ?????.
TAO Toolkit 3.0? ???? ??? AI ?? ??
TAO Toolkit? NVIDIA PyPI (Private Python Package)?? pip? ???? ??? ? ?? ??? ???? ?? ?????. ???? TAO Toolkit Launcher?? ?? ????? ?????. ?? ?? ?? ??? ?????.
- ?? ??? ?? docker-ce? ?????. ?? ?? ?? ? ??? ?? ??? ??? ?? ??(?, sudo ??) ??? ? ??? ?????.
- ??? ?? nvidia-container-toolkit? ?????.
- NGC Docker ?????? ??????.
$ docker login nvcr.io
Authenticating with existing credentials…
..
Login Succeeded
??? ??? ?? ??? ???? ???? ?? ???? ????? TAO Toolkit ??? ???? ?? ?????.
# Install a virtual environment and activate it.
$ virtualenv -p python3 tao-env
$ source tao-env/bin/activate
????? NVIDIA Python Package Index? ???? TAO Toolkit ?? ?????.
# Install the NVIDIA Python Package Index.
$ pip install nvidia-pyindex
# Install the TAO Toolkit wheel.
$ pip install nvidia-tao
?? TAO Toolkit? ??? ??? ?? ?????. ?? ? tao <task> <subtask> <parameters> ???? ???? ?? ??? ???? TAO Toolkit Launcher? ??????. ???? ??? ??? ???? ??? tao –help? ?????. ??? ??? TAO Toolkit Launcher ?? ????? ??? ? ????.
$ tao --help
usage: tao [-h]
{info,list,stop,augment,classification,detectnet_v2,dssd,emotionnet,faster_rcnn,fpenet,gazenet,gesturenet,heartratenet,intent_slot_classification,lprnet,mask_rcnn,punctuation_and_capitalization,question_answering,retinanet,speech_to_text,ssd,text_classification,tao-converter,token_classification,unet,yolo_v3,yolo_v4}
? ????
TAO Toolkit? ??????? ?? ????? ???? ?? ??? ??? ????? ?????. ? ????? TAO Toolkit Launcher ?? ??? ???? ??? ??? ????. ???? ?? ? ?? ???, ?? ??, ??? ??? ??? ????? ?? ???? ????. ?? ??? ?????? ?? ??? ?????? ??? ? ?? .cache ????? ????? ???. ??? ?? ? ?? ?? ?? ??? ??? ??? ????? ??? ??? ???? ?????? ?? ??? ? ????.
??? ????? ??? ??? ???? ?? ????? ??, ????? ~/.tao_mounts.json ???? ??? ? ????. ??? ??? ?? ????? ?????.
?? ?? ??? ?? ?????. Source ?? ???? ????? ???? destination?? ?? ?????? ???? ?????.
# Content of the file ~/.tao_mounts.json:
{
"Mounts":[
{
"source": "~/tao/data",
"destination": "/data"
},
{
"source": "~/tao/specs",
"destination": "/specs"
},
{
"source": "~/tao/results",
"destination": "/results"
},
{
"source": "~/.cache",
"destination": "/root/.cache"
}
],
"DockerOptions":{
"shm_size": "16G",
"ulimits": {
"memlock": -1,
"stack": 67108864
}
}
}
?? ??? ???? ??? ?? ?? ??
??? NLP ???? ?? ???? BERT ?? ??? ??? ?????. ??? ??? ??? ?? ???? ?? ?? ????? ???? ???? ?????.
?? ????? ??? ??? ? ?? ??????? ??? ???.
- ?? ?? – ????? ?? ??? ??? ?? ??? ??? ?????.
- ??? ?? – ????? ?? ?? ?? ??????.
- NLP ???? TAO Toolkit 3.0? ???? ?? ??? ??? ? ?? ? ?? ??? ????.
?? ?? ?? ????
TAO Toolkit Launcher? ???? ? ?? ?? ?? ?????? ??? ?? ??? ??? ? ????. ??? ?? ??? ????? ????, ?? ????, ?????? ?? ???????? ?? ?? ????? ??? ????? ??????. TAO Toolkit? ???? ?? ?? ? ??? ??? ????? ???? ?? ?? ??? ??? ??? ??? ????.
??? ?? ??? ???? ?????, tao <task> download_specs <args>? ???? ? ?? ?? ?????? ?? ????? ? ?? ??? ???? ??? ? ????. ??? ?? ? ???? ?? ?? ????? ????? ???? ?? ??. ?? ???? ?? ?? ??? ???? ?? ?????? ?? ??? ??? ??? ???? ??? ? ????.
?? ????? ??? ?? ??? ?? ??? ?? ??? ???????.
# Here, -r and -o specify the results and the output directories, respectively.
# These directories are from the perspective of the Docker container.
$ tao text_classification download_specs \
-r /results/nlp/text_classification/download_specs/ \
-o /specs/nlp/text_classification/
# Verify that the specs are present on your machine:
$ ls ~/tao/specs/nlp/text_classification/
dataset_convert.yaml export.yaml infer_onnx.yaml train.yaml
evaluate.yaml finetune.yaml infer.yaml
??? ?? ??? ????? ??? ???? -o ??? ??? ??? ??? ????? ???? -r ??? ?????. -o ??? ? ??? ???? ???.
?? ??? ???? ???? ?? ?? ?? ??
?? ?? ????? ????? ?? ??? Stanford Sentiment Treebank (SST-2) ??? ??? ?????. ???? ?? ???? ??? 11,855? ??? ?? ??? ?? ???? ?? 215,154?? ??? ??? ????. ??? ???(5 ??) ?? ??(??/??) ?? ??? ?? ??? ? ???, ??? ???? ???? ?????. SST-2 ??? ? ????? ??, ? ??, ??, ??? ???? ?? .tsv ??? ?????. ? ???? ???? ??? ??? ??, ?? ???? ????.
??? ????
SST-2.zip ????? ??????, ???? ???? TAO Toolkit Docker? ???? ? ?? ??? ???? ????? ??? ???. ? ???? home ??? /data ?????.
# Download the archive.
$ wget https://dl.fbaipublicfiles.com/glue/data/SST-2.zip
# Unzip the archive.
$ unzip SST-2.zip -d ~/tao/data
??? ??
??? ????? ?? ???? ?? ? ?? ??? ??? ?????. TAO Toolkit? ??, ?? ??, ?? ?? ??? ??? ???? ?? ???? ?? ???? ?? ????? ?? ????(tao <task> dataset_convert <args>)? ? ??? ?????.
??? ?? ??? ??, TAO Toolkit dataset_conversion ????? ????? ?? ??? ? ?? ????? SST-2? IMDB? ?????. ? ?????? SST-2? ?????.
$ tao text_classification dataset_convert \
-e /specs/nlp/text_classification/dataset_convert.yaml \
-r /results/nlp/text_classification/dataset_convert \
dataset_name=sst2 \
source_data_dir=/data/SST-2 \
target_data_dir=/data/sst2
?? ?? ??? ????? ???? -e ??? ?? ??? ??? ??? ????? ???? -r ??? ?????. ?? ??? ?? ????? ??? ????? ?????.
?????? ??? ???? ??? ? ?????? ?? ??? ??(tao <task> train <args>) ?? ?? ?? tao <task> finetune <args>)? ???? ????.
?? ??? ???? ?? ??
????? ???? TAO Toolkit?? ???? ?? NLP ??? ???-??? ??? ?? ????? ???, ???? BERT(Bidirectional Encoder Representations from Transformers)? ?? ? ??? ???? ???(non-regressive) ??????. NLP ??? BERT ?? ????? ?? ??? ??? ? ???? ???? ?????.

?? 3. ?? ??? ???? ??? ?? ??? ????? ???? ?????.
TAO Toolkit?? NLP ??? ??? ? ? ?? ??? ????. ???? ?????, ?? ??? NLP ??? ?? ?? ??? BERT ?? ???? ???? ??? ??? ? ????. ? ?????? ??? ??? ??? ????(?? 3). model:? language_model? ?? ???? ?? ??? BERT ?? ???? ??? ?? ??? ???? ???.
# Content of the ~/tao/specs/nlp/text_classification/train.yaml
...
model:
...
language_model:
pretrained_model_name: bert-base-uncased
...
??? ??? ?? ??? ?? ?? ??? ????? ?? ??? ?????. ??? ??? ??? ??? ??? ?????.
??? ????? tao text_classification train <args> ??? ???? ???.
- -e: ?? ?? ?? ??? ??.
- -r: ?? ??? ??? ???? ??? ??.
- -g: ??? GPU ?.
- -k: ??? ????? ???? ?? ??? ??? ?? ??? ?.
- -r: ??? ??? ????? ???? ?? ???.
- ?? ??? ????? ?? ?? ?????.
? ??? ??? ?? ???? ??? ? ????. ? ???? ??? ???? ? ? ??? ??? ??? ?? ?????? ?? ???? TAO Toolkit ?? ???? ?????.
$ tao text_classification train \ -e /specs/nlp/text_classification/train.yaml \ -r /results/nlp/text_classification/train \ -g 1 \ -k $KEY \ training_ds.file_path=/data/sst2/train.tsv \ validation_ds.file_path=/data/sst2/dev.tsv \ training_ds.num_samples=500 \ validation_ds.num_samples=500 \ trainer.max_epochs=3
????? ??? ??, ????? ?? ??, ??? ?? ???, ?? ????? ?? ?? ??? ?? ?? ?? ????? ???? ??? trained-model.tao???? ?????. ? ??? KEY ?? ??? ??? ??????.
# Key that is used for encryption of your TAO Toolkit model.
$ KEY = "<your encryption key>"
??? ?? ?? ?? ??
TAO Toolkit? NGC?? ????? ?? ??? ?? ?? ??? ?? ?? ?? ??? ?????. ?? ????? ??? ???? ?? ???? ??? ?????.
NGC?? ?? ??? ?? ????
TAO Toolkit? NGC?? ?? ??? ?????. NGC TAO Toolkit Text Classification ?? ???? ?? ??? ??? ???????. ?? ???? ?? /results ??? ???????.
# Download text classification model pretrained on the Misty chatbot domain dataset.
$ wget --content-disposition https://api.ngc.nvidia.com/v2/models/nvidia/tao/domainclassification_english_bert/versions/trainable_v1.0/zip -O domainclassification_english_bert_trainable_v1.0.zip
# Unzip the archive.
$ unzip domainclassification_english_bert_trainable_v1.0.zip
# Move the model file to the mounted result folder.
$ mv domainclassification_english_bert.tlt ~/tao/results/

?? 4. ?? ??? ?? ?? ??.
?? ??? ?? ?? ??
TAO Toolkit?? ??? ?? ??? ?? ????? tao text_classification finetune <args> ??? ?????. ??? ???? ??? ?? ??? ?? ???? ?? ??? ??? ?? ??? ?? -m ??? ??? ????. ??? -m? ?? ??? ?? ??? ?????.
? ???? ?????? ??, ?? ??? ??? ???? ???? ???. ??? ??? ??? ??? ?????. ??? ????, ?? ??? ??? ???? ?? ??? is?~/tao/data/my_domain_classification/??? ???? ?? ??? ??? ?? ???? ??? ??? ??? ???? ????????. ?? ???? ????? nlp-tc-trained-model.tao???? ???? ?????.
$ KEY="tlt_encode" tao text_classification finetune \
-e /specs/nlp/text_classification/finetune.yaml \
-r /results/nlp/text_classification/finetune \
-m /results/domainclassification_english_bert.tlt \
-g 1 \
-k $KEY \
finetuning_ds.file_path=/data/my_domain_classification/train.tsv \
validation_ds.file_path=/data/my_domain_classification/dev.tsv
? ?? NGC ??? ??? ?? tlt_encode???.
?? ??
?? ?? ??? ??? ??? ???? ??? ??? ??? ???? ????. tao <task> evaluate <args>:? ?????.
$ tao text_classification evaluate \
-e /specs/nlp/text_classification/evaluate.yaml \
-r /results/nlp/text_classification/evaluate \
-m /results/nlp/text_classification/train/checkpoints/trained-model.tao \
-g 1 \
-k $KEY \
test_ds.file_path=/data/sst2/test.tsv \
test_ds.batch_size=32
?? ??
?? ?? ?? ???, TAO Toolkit? ??? ???? ????? ????? ??? ?? ?? ??(speech_to_text???? ?? .wav ??, question_answering???? ?? ?? ??? ?? ?? ?)? ?? ??? ???? ? ??? <task> infer <args>??? ??? ???? ???. ? ?? ??? ???? ??? ?? ??? ??? ???? ??? ? ??? ??? ?????.
# For inference:
$ tao text_classification infer \
-e /specs/nlp/text_classification/infer.yaml \
-r /results/nlp/text_classification/infer \
-m /results/nlp/text_classification/train/checkpoints/trained.tao \
-g 1 \
-k $KEY
?? ????
????? ??? ???? ????? ???? tao <task> export <args> ??? ???? ????? ??? ? ????.
# For export to Riva:
# For export to Riva:
$ tao text_classification export \
-e /specs/nlp/text_classification/export.yaml \
-r /results/nlp/text_classification/export \
-m /results/nlp/text_classification/train/checkpoints/trained.tao \
-k $KEY
????, /results/nlp/text_classification/export ??? exported-model.riva ??? ?????. ???? ?? ??? ?? ??? ONNX (Open Neural Network Exchange) ?? (.eonnx)?? ??? ?? ????. export_format=ONNX ????? ???? ???? ???. ??? ???? tao <task> infer_onnx <args> ??? ????, ??? ONNX ??? ??? ???? ?? ????. ??? ??? ?? ???? ?? Riva? Riva ?? ??? ?? ?? ???? ?? ??? ????.
?? TAO Toolkit ??? ?? ??? ??? TAO Toolkit v3.0 ?? ???? ??????. ?? ? ??? ????? ???? ?? ??? AI ??? ?? ???? ?????.
??? AI ??? Riva?? ??? ???? ??
NVIDIA Riva? GPU? ??? ?? AI ???? ???? ?? GPU ?? SDK???. Riva SDK?? ASR, NLP, TTS ??? ?? ?? ??? ??, ??, ???? ?? ? ?? ???? ??? ????. Riva? ???? GPU?? ??? ???? ???? ??? ?????. GPU? ?? ??? ??? ???? ??, Riva? NVIDIA Triton Inference Server? ??? ???? ???? NVIDIA TensorRT? ??? ?????. ? ??, ??? ???? CPU ?? ????? ??? 25??? ?? ?? 150ms? ??? ? ????.
Riva? ??? TAO Toolkit ??(?? ???? ??.riva ??)? ????? ??? ?? ??(?? ???, ?? ???, ?? ??, ??? ??? ?? ?)? ???? ????? Riva ServiceMaker? ???? ?? ??? ?????. ?? 5? Riva ServiceMaker? riva-build ? riva-deploy ? ?? ?? ?? ??? ???? ??? ?????.

?? 5. Riva ServiceMaker? ???? ??? TAO Toolkit ?? ??.
Riva ?? ?? ?? ??
??, ??? ??? ?? ?? ??? ?????. ? ???? ??? TAO Toolkit?? ???? ??? ?? ?? ??? ????? ?? ?? ??? ???? ???.
# Location of Riva Quick Start.
RIVA_QUICK_START=nvidia/riva/riva_quickstart:1.6.0-beta
# Location Riva ServiceMaker Docker image.
RIVA_SM_CONTAINER=nvcr.io/nvidia/riva/riva-speech:1.6.0-beta-servicemaker
# Directory where the .riva model exported from TAO Toolkit is stored.
EXP_MODEL_LOC=/results/nlp/text_classification/export
# Name of the .riva file.
EXP_MODEL_NAME=exported-model.riva
# Riva Model Repository folder where the *.rmir and other required assets are stored.
RIVA_REPO_DIR=/data/
# In the following, you reuse the $KEY variable used in TAO Toolkit.
? ???? /data ??? Riva Model Repository ??? ??????. ? ??? Riva Quick Start ?????? ???? ???? ?????. ?? ??? ???? ? ??? ?? ??? ?? ?? ???? ???? ? ???? ?????.
????, Riva Quick Start ????? ?????. ?? ??? ??? NGC ?????? ?? ?????. NGC CLI? ???? ?? ??? ?????.
# Download Riva Quick Start:
$ ngc registry resource download-version $RIVA_QUICK_START
????? Riva ServiceMaker Docker ???? ?????.
# Get the ServiceMaker Docker container
$ docker pull $RIVA_SM_CONTAINER
?? ?? ??? ????.
Riva ?? ??
riva-build?? ?? ??? ??? ??(.riva???)? Riva ?? ?? ??(.rmir)??? ?? ?? ??? ???? ?? ??? ???? ??? ???. ? ???? ?? ??? ??? ??? ?? ??? ?? ?? ?? ? ?? ?????? ?? ?????(agnostic) ??? ??? ????. Riva ServiceMaker Docker ??? ??? riva-build ??? ?????, ?? ??? ?????.
# Run the riva-build to generate an .rmir ensemble.
$ docker run --gpus all --rm -v $EXP_MODEL_LOC:$EXP_MODEL_LOC -v $RIVA_REPO_DIR:/data --entrypoint="/bin/bash" $RIVA_SM_CONTAINER -- \
riva-build text_classification -f /data/rmir/tc-model.rmir:$KEY \
$EXP_MODEL_LOC/$EXP_MODEL_NAME:$KEY
Riva ?? ??
riva-deploy ?? ?? .rmir ??? ???? ?? ??? ?? ?????? ???? ??? ??? ?????.
? ?? ??? ???? Riva Quick Start? ?? ???? ????? ?????. riva-deploy? ???? ???? ??? ?? ??? ??? Riva Deploy? ?????.
Quick Start? ???? Riva ?? ??
Riva?? ??? ???? ? ?? ??? ????. ? ?? ??, ??? NGC?? ??? Riva Quick Start? ???? ?? ??????? ?????. Pull?? ??? ???? config.sh???? ????. ?? ?? ????? ?? ?? $RIVA_DIR? ???? ? ??? ?????. config.sh ??? ???? ?? ?? ??? ?????.
# Enable NLP service only.
service_enabled_asr=false ## MAKE CHANGES HERE
service_enabled_nlp=true ## MAKE CHANGES HERE
service_enabled_tts=false ## MAKE CHANGES HERE
# ...
# Specify the encryption key to use to deploy models.
MODEL_DEPLOY_KEY=<key you have used> ## MAKE CHANGES HERE
# ...
# Indicate that you want to use .rmir generated previously.
use_existing_rmirs=true ## MAKE CHANGES HERE
# ...
# Set Riva Model Repository path to folder with your model.
riva_model_loc=/data ## MAKE CHANGES HERE
??? ?? ??? Quick Start ????? ???? riva-deploy? ???? Riva ?? ??? ????? ?????.
# Ensure that you have permissions to execute these scripts.
$ cd $RIVA_DIR
$ chmod +x ./riva_init.sh && chmod +x ./riva_start.sh
# Initialize Riva model repo with your custom RMIR.
$ riva_init.sh
# Start the Riva server and load your custom model.
$ riva_start.sh
????? ?????? ??
Riva ??? ???? ??? ?? ???? ??? ???? ?? ??? ?? ? ????. gRPC ??? ???? Riva ????? Python API ???? ?????. ? API? Riva Quick Start? ?? pip .whl?? ?????.
# Install Riva client API bindings.
$ cd $RIVA_DIR && pip install riva_api-1.0.0b1-py3-none-any.whl
?? ???? ???? ?????? ?????.
import grpc
import argparse
import os
import riva_api.riva_nlp_pb2 as rnlp
import riva_api.riva_nlp_pb2_grpc as rnlp_srv
class BertTextClassifyClient(object):
def __init__(self, grpc_server, model_name):
# generate the correct model based on precision and whether or not ensemble is used
print("Using model: {}".format(model_name))
self.model_name = model_name
self.channel = grpc.insecure_channel(grpc_server)
self.riva_nlp = rnlp_srv.RivaLanguageUnderstandingStub(self.channel)
self.has_bos_eos = False
# use the text_classification network to return top-1 classes for intents/sequences
def postprocess_labels_server(self, ct_response):
results = []
for i in range(0, len(ct_response.results)):
intent_str = ct_response.results[i].labels[0].class_name
intent_conf = ct_response.results[i].labels[0].score
results.append((intent_str, intent_conf))
return results
# accept a list of strings, return a list of tuples ('intent', scores)
def run(self, input_strings):
if isinstance(input_strings, str):
# user probably passed a single string instead of a list/iterable
input_strings = [input_strings]
# get intent of the query
request = rnlp.TextClassRequest()
request.model.model_name = self.model_name
for q in input_strings:
request.text.append(q)
ct_response = self.riva_nlp.ClassifyText(request)
return self.postprocess_labels_server(ct_response)
def run_text_classify(server, model, query):
print("Client app to test text classification on Riva")
client = BertTextClassifyClient(server, model_name=model)
result = client.run(query)
print(result)
????? ??
?? ?????? ??? ??? ????.
# Run the function.
run_text_classify(server="localhost:50051", model="<Enter Model Name>", query="How is the weather tomorrow?")
??? ???? ??? ?? ??? ?????.
Client app to test text classification on Riva
Using model: riva_text_classification
[('negative', 0.5620560050010681)]
??? ???? TAO Toolkit? ???? ??? ????, Riva? ????, Riva ?? ??? ????, Riva API? ???? ??? ?????? ???? ??? ?????. ?????!
TAO Toolkit 3.0?? ???? ?? ??? AI ??? ??
?? ??? ??? ?? ??? ?? TAO Toolkit 3.0 ????? ???? ?? ? ??? ????. ? ???? ??? AI ???? ASR ? NLP?? ? ?? ??? ??? ?????. ? ????? TTS? ???? ?? ??? ??? TTS ??? ??? ???? ?? ?? ?????. ??? ???? ??? ??? ????. ?? ?? ????? ?? ??? ?? ?? ????.
?? ?? ?? ???
?? ?? ??(ASR)? ?? ?? ???? ?? ?? ??? ???? ?????. ? ???? ???? ???? ??? ?? ??? ?? ??? ???, ??? ?? ???? ???? ???? ????, ????? ?? ?? ??? ???? ?? ???? ???? ? ?? ????.
?? TAO Toolkit 3.0? ASR ???? ?? ??, ?? ?? ?? ??? ??(STT)(tao speech_to_text <subtask> <args>)? ????, ? ??? ?? ??? ?????. ??? ??? ??? ??? ??? ? ????. ?? ???? STT? ??? ?? ??? ??? ? ????.
TAO Toolkit ???? ? ?? ??? ??? ? ????. ?? ??? ?? ????(convolutional) ?? ?? ?????.
- Jasper ????? ?? ????? ?? GPU ??? ???? ?? GPU ??? ???? ??? ??????. ?? ???? ?? STT? ??? ??? ?? ??? ???? ? ?????.
- QuartzNet? ?? ??? ????? ? ? ?? ??? ???? Jasper? ??? ???????. ????? ?? ????? Jasper? ??? ???? ?????.
- Citrinet ? ???? ???? SE(squeeze-and-excitation)? ??? 1D ?? ?? ?? ??? ????? ???? QuartzNet ?????. ?? ????? ?????(non-autoregressive), ???-?-???, ??? ?? ?? ??? ?? ????.
??? ?? ???
??? ??(NLP)? ??? AI ??????? ? ?? ?? ?????. ? ???? ???? ??? ??, ??? ?? ??, ??? ?? ??? ??, ?? ???? ??? ??, ??? ????? ?? ?? ??? ?????.
TAO Toolkit 3.0? NLP ???? 5?? ??? ?? ?? ??? ?????.
- ?? ?? & ?? ?? (tao intent_slot_classification <subtask> <args>)? ???? ??? ???? ? ??? ?? ?? ?? ??(???)? ???? ?????. ?? ?? “?? ?? ????? ????”??? ?????, ??? “??” ??? ????, “?????”? ?? ???? ????, “?? ??”? date_time ???? ?????. ??? ?? ??? ?? ??? ?? ??? ?? ???? ???? ?????. ?? ?? ?? ?? ??? AI ???? ???? ?? ?????.
- ?? ??? & ??? ?? (tao punctuation_and_capitalization <subtask> <args>) ?? ?? ?? ??? ?? ??? ?? ??? ?? ??? ?? ???? ??? ???? ???? ??? ???? ???.
- ?? ?? (tao question_answering <subtask> <args>)?? ??? ? ??? ????? ?? ???? ??? ??? ?? ??? ???? ??? ? ??? ???? ???? ? ??? ???? ???.
- ??? ?? (tao text_classification <subtask> <args>)? ?? ??, ??? ??, ?? ??, ?? ??? ?? ?? ??????? ??? ? ?? ?????? ??? NLP ?????. ?? ??, ?? ???? “??? ????!”?? ??? ???? ??? ??? ?? ??, “??? ?????? ?? ????? ??”? ???? ??? ??? ????.
- ?? ?? (tao token_classification <subtask> <args>)? ?? ??? ? ???(?: ??)? ??? ???? ???? ???? ?????. ??? ??? ??(NER)? ????? ?? ??(???)? ??, ???? ?? ??? ?? ?? ?? ??? ? ?????????. ?? ?? “??? ?????? ?? NVIDIA?? ????”?? ????, ??? “Mary”? ??, “?????”? ??, “NVIDIA”? ???? ???? ???.
TAO Toolkit?? ???? ?? NLP ??? BERT ? ?? ???? ?????. BERT? Transformer ?? ??(attention) ?? ????? ???? ????? ?? ?? ??? ???? ?? ?? ???? ?????. BERT? ?? ??? ?? ?? ??? ????. ??? ? ??? ???? ???? ? ?? ???(unsupervised) ?? ??? ?? ?????. ??? ??? ??? ?? ??? ??? ?? ??? ????, ? ??? ??? NLP ???? ??? ??? ???? ?? ???? ?? ??? ? ????.
??
???? TAO Toolkit? ?? ??? ??? ???? ??????? ?? ??? ?? ???? ?? ??? ?? ????? ??? ??? ?????? ?? ?? ??? ?? ???????? ?? ????? ??????.
?? ??? ?? ??, ?? ??, ??? ???, ?? ?? Riva?? ?? ??, NGC? ?? ?? ??? ?? ??? ?? TAO Toolkit? ???? ???? ?? ????? ??? ?? 10? ??? ?? ??? ???. NVIDIA? TAO Toolkit? ?? ??? ??? AI? ??? ?? ?? ????? ??? ? ??? ????.
??? ??? ?? ???? ?????.