nemo / README.md
Vadim
add Punctuation and Capitalization Model
e6ac6c7
|
Raw
History Blame
5.22 kB
---
language:
- uk
- ru
library_name: nemo
tags:
- deepspeech
---
# list models
### QuartzNet15x5
---
- 2023-04-28
- _language:_ ru
- _from_pretrained:_ [stt_en_quartznet15x5](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/nemo/models/stt_en_quartznet15x5)
- _Epoch:_ 50
- _Step:_ 738649
- _val_loss:_ 4.19466 (best 4.19466)
- _model:_ ```quartznet15x5/2023-04-28_00-24-37/stt_ru_quartznet15x5.nemo```
- _last checkpoint:_ ```quartznet15x5/2023-04-28_00-24-37/stt_ru_quartznet15x5--val_loss=4.2732-epoch=50-last.ckpt```
- _Dataset train:_ **709100** files totalling **680.21** hours
- _Dataset validation:_ **14670** files totalling **15.63** hours
- 2023-04-04
- _language:_ uk
- _from_pretrained:_ [stt_en_quartznet15x5](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/nemo/models/stt_en_quartznet15x5)
- _Epoch:_ 34
- _Step:_ 566076
- _val_loss:_ 1.90886 (best 1.89907)
- _model:_ ```quartznet15x5/2023-04-04_02-57-02/stt_uk_quartznet15x5.nemo```
- _last checkpoint:_ ```quartznet15x5/2023-04-04_02-57-02/QuartzNet15x5--val_loss=1.9543-epoch=34-last.ckpt```
- _Dataset train:_ **1042635** files totalling **1028.14** hours
- _Dataset validation:_ **50640** files totalling **50.71** hours
- 2023-02-23
- _language:_ uk-RU
- _from_pretrained:_ [stt_en_quartznet15x5](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/nemo/models/stt_en_quartznet15x5)
- _Epoch:_ 7
- _Step:_ 217287
- _val_loss:_ 1.66200 (best 1.66200)
- _model:_ ```quartznet15x5/2023-02-23_11-43-23/stt_uk_ru_quartznet15x5.nemo```
- _last checkpoint:_ ```quartznet15x5/2023-02-23_11-43-23/QuartzNet15x5--val_loss=1.6620-epoch=7-last.ckpt```
- _Dataset train:_ **1738252** files totalling **1645.74** hours
- _Dataset validation:_ **11373** files totalling **12.63** hours
### Jasper10x5
---
- 2023-04-07
- _language:_ uk
- _from_pretrained:_ [stt_en_jasper10x5dr](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/nemo/models/stt_en_jasper10x5dr)
- _Epoch:_ 17
- _Step:_ 293256
- _val_loss:_ 2.10919 (best 2.10919)
- _model:_ ```jasper10x5/2023-04-07_05-01-29/stt_uk_jasper10x5.nemo```
- _last checkpoint:_ ```jasper10x5/2023-04-07_05-01-29/Jasper10x5--val_loss=2.1092-epoch=17-last.ckpt```
- _Dataset train:_ **1042635** files totalling **1028.14** hours
- _Dataset validation:_ **50640** files totalling **50.71** hours
- 2023-02-22
- _language:_ uk-RU
- _from_pretrained:_ [stt_en_jasper10x5dr](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/nemo/models/stt_en_jasper10x5dr)
- _Epoch:_ 4
- _Step:_ 271604
- _val_loss:_ 1.76058 (best 1.76058)
- _model:_ ```jasper10x5/2023-02-22_06-46-21/stt_uk_ru_jasper10x5.nemo```
- _last checkpoint:_ ```jasper10x5/2023-02-22_06-46-21/Jasper10x5--val_loss=1.7606-epoch=4-last.ckpt```
- _Dataset train:_ **1738252** files totalling **1645.74** hours
- _Dataset validation:_ **11373** files totalling **12.63** hours
# Punctuation and Capitalization Model
### punctuation_uk_bert
---
- 2023-06-28
- _language:_ uk
- _Epoch:_ 3
- _val_loss:_ 0.0319
- _last checkpoint:_ ```punctuation_uk_bert/2023-06-28_04-10-06/punctuation_uk_bert--val_loss=0.0385-epoch=3-last.ckpt```
### punctuation_ru_bert
---
- 2023-06-28
- _language:_ rU
- _Epoch:_ 5
- _val_loss:_ 0.0196
- _last checkpoint:_ ```punctuation_ru_bert/2023-06-28_15-12-29/punctuation_ru_bert--val_loss=0.0712-epoch=5-last.ckpt```
### Використання ASR:
```python
from huggingface_hub import hf_hub_download
from nemo.collections.asr.models import ASRModel
from omegaconf import OmegaConf
# filename_model = 'quartznet15x5/2023-02-23_11-43-23/stt_uk_ru_quartznet15x5.nemo'
# filename_model = 'quartznet15x5/2023-04-04_02-57-02/stt_uk_quartznet15x5.nemo'
# filename_model = 'jasper10x5/2023-02-22_06-46-21/stt_uk_ru_jasper10x5.nemo'
filename_model = 'jasper10x5/2023-04-07_05-01-29/stt_uk_jasper10x5.nemo'
model_path = hf_hub_download(
repo_id="u107/nemo",
filename=filename_model,
repo_type="model",
cache_dir='/content',
use_auth_token='hf_...')
nemo_model = ASRModel.restore_from(
restore_path=model_path,
# map_location='CPU',
# return_config=True,
) # type: ASRModel
# зберегти файл налаштувань
OmegaConf.save(nemo_model.cfg, 'model_config.yaml')
# відобразити версію nemo на якій було навчання
print(nemo_model.cfg.nemo_version)
# відобразити алфавіт
print(nemo_model.cfg.labels)
```
### Використання NLP:
```python
from huggingface_hub import hf_hub_download
from nemo.collections import nlp as nemo_nlp
# filename_model = 'punctuation_ru_bert/2023-06-28_15-12-29/punctuation_ru_bert.nemo'
filename_model = 'punctuation_uk_bert/2023-06-28_04-10-06/punctuation_uk_bert.nemo'
model_path = hf_hub_download(
repo_id="u107/nemo",
filename=filename_model,
repo_type="model",
cache_dir='/content',
use_auth_token='hf_...')
pretrained_model = nemo_nlp.models.PunctuationCapitalizationModel.restore_from(
restore_path=model_path
)
queries = [
'ніхто ж не каже що б давати так',
]
result = pretrained_model.add_punctuation_capitalization(queries=queries)
print(result)
```