diff --git a/README.md b/README.md index ff1f6f6..63c5f7e 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,10 @@ model-index: metrics: - name: Test WER type: wer - value: 29.30 + value: 27.08 --- -# Wav2Vec2-Base-960-Turkish +# Wav2Vec2-Base-760-Turkish # TBA Pretrained Turkish model [ceyda/wav2vec2-base-760](https://huggingface.co/ceyda/wav2vec2-base-760). Fine-tuned on Turkish using the [Common Voice](https://huggingface.co/datasets/common_voice) @@ -87,7 +87,7 @@ processor = Wav2Vec2Processor.from_pretrained("ceyda/wav2vec2-base-960-turkish") model = Wav2Vec2ForCTC.from_pretrained("ceyda/wav2vec2-base-960-turkish") model.to("cuda") -chars_to_ignore_regex = '[\\,\\?\\.\\!\\-\\;\\:\\"\\“\\‘\\”\\'\\`…\\’»«]' +chars_to_ignore_regex = '[\,\?\.\!\-\;\:\"\“\‘\”\'\`…\’»«]' resampler = torchaudio.transforms.Resample(48_000, 16_000) # Preprocessing the datasets. @@ -117,7 +117,7 @@ result = test_dataset.map(evaluate, batched=True, batch_size=8) print("WER: {:2f}".format(100 * wer.compute(predictions=result["pred_strings"], references=result["sentence"]))) ``` -**Test Result**: XX.XX % (TBA) +**Test Result**: 27.08 % (in progress) ## Training diff --git a/config.json b/config.json new file mode 100644 index 0000000..cf53f72 --- /dev/null +++ b/config.json @@ -0,0 +1,67 @@ +{ + "_name_or_path": "./pretrained/checkpoint_0.60", + "activation_dropout": 0.1, + "apply_spec_augment": true, + "architectures": [ + "Wav2Vec2ForCTC" + ], + "attention_dropout": 0.1, + "bos_token_id": 1, + "conv_bias": false, + "conv_dim": [ + 512, + 512, + 512, + 512, + 512, + 512, + 512 + ], + "conv_kernel": [ + 10, + 3, + 3, + 3, + 3, + 2, + 2 + ], + "conv_stride": [ + 5, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "ctc_loss_reduction": "mean", + "ctc_zero_infinity": true, + "do_stable_layer_norm": false, + "eos_token_id": 2, + "feat_extract_activation": "gelu", + "feat_extract_norm": "group", + "feat_proj_dropout": 0.1, + "final_dropout": 0.1, + "gradient_checkpointing": true, + "hidden_act": "gelu", + "hidden_dropout": 0.05, + "hidden_size": 768, + "initializer_range": 0.02, + "intermediate_size": 3072, + "layer_norm_eps": 1e-05, + "layerdrop": 0.1, + "mask_feature_length": 10, + "mask_feature_prob": 0.0, + "mask_time_length": 10, + "mask_time_prob": 0.5, + "model_type": "wav2vec2", + "num_attention_heads": 12, + "num_conv_pos_embedding_groups": 16, + "num_conv_pos_embeddings": 128, + "num_feat_extract_layers": 7, + "num_hidden_layers": 12, + "pad_token_id": 36, + "transformers_version": "4.5.0.dev0", + "vocab_size": 37 +} diff --git a/preprocessor_config.json b/preprocessor_config.json new file mode 100644 index 0000000..0886a48 --- /dev/null +++ b/preprocessor_config.json @@ -0,0 +1,8 @@ +{ + "do_normalize": true, + "feature_size": 1, + "padding_side": "right", + "padding_value": 0.0, + "return_attention_mask": true, + "sampling_rate": 16000 +} diff --git a/pytorch_model.bin b/pytorch_model.bin new file mode 100644 index 0000000..6b20cde --- /dev/null +++ b/pytorch_model.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ecb5a521af5105ca67abd19a841c08e97b071a8b69e186b06b25633c6fc36804 +size 377690860 diff --git a/special_tokens_map.json b/special_tokens_map.json new file mode 100644 index 0000000..9abf719 --- /dev/null +++ b/special_tokens_map.json @@ -0,0 +1 @@ +{"bos_token": "", "eos_token": "", "unk_token": "[UNK]", "pad_token": "[PAD]"} \ No newline at end of file diff --git a/tokenizer_config.json b/tokenizer_config.json new file mode 100644 index 0000000..a2a8340 --- /dev/null +++ b/tokenizer_config.json @@ -0,0 +1 @@ +{"unk_token": "[UNK]", "bos_token": "", "eos_token": "", "pad_token": "[PAD]", "do_lower_case": false, "word_delimiter_token": "|"} \ No newline at end of file diff --git a/vocab.json b/vocab.json new file mode 100644 index 0000000..7f974b7 --- /dev/null +++ b/vocab.json @@ -0,0 +1 @@ +{"e": 0, "x": 1, "î": 2, "l": 3, "â": 4, "j": 5, "ç": 6, "ş": 7, "g": 8, "ı": 9, "v": 10, "d": 11, "t": 12, "n": 13, "a": 14, "c": 15, "h": 16, "p": 17, "r": 18, "w": 19, "z": 20, "k": 21, "u": 22, "b": 23, "ü": 24, "y": 26, "o": 27, "q": 28, "m": 29, "f": 30, "s": 31, "ö": 32, "ğ": 33, "i": 34, "|": 25, "[UNK]": 35, "[PAD]": 36} \ No newline at end of file