computeram commited on
Commit
82d866f
·
verified ·
1 Parent(s): 2a8d8fa

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - kmr
4
+ license: mit
5
+ library_name: transformers
6
+ tags:
7
+ - automatic-speech-recognition
8
+ - wav2vec2-bert
9
+ - kurdish
10
+ - badini
11
+ - kurmanji
12
+ - low-resource
13
+ base_model: facebook/w2v-bert-2.0
14
+ pipeline_tag: automatic-speech-recognition
15
+ ---
16
+
17
+ # Badini Kurdish ASR (Wav2Vec2-BERT)
18
+
19
+ An automatic speech recognition (ASR) model for **Badini Kurdish** (a variety of
20
+ Kurmanji, written in Arabic script), fine-tuned from
21
+ [`facebook/w2v-bert-2.0`](https://huggingface.co/facebook/w2v-bert-2.0)
22
+ with a CTC head.
23
+
24
+
25
+ ## Input requirements
26
+
27
+ - Audio must be **16 kHz, mono**.
28
+ - Resample any other sample rate to 16 kHz before running inference.
29
+
30
+ ## Usage
31
+
32
+ ```python
33
+ import torch, soundfile as sf
34
+ from transformers import Wav2Vec2BertForCTC, Wav2Vec2BertProcessor
35
+
36
+ repo_id = "computeram/badini-w2v-bert"
37
+ processor = Wav2Vec2BertProcessor.from_pretrained(repo_id)
38
+ model = Wav2Vec2BertForCTC.from_pretrained(repo_id).eval()
39
+
40
+ speech, sr = sf.read("audio.wav") # 16 kHz mono
41
+ inputs = processor(speech, sampling_rate=16000, return_tensors="pt")
42
+ with torch.no_grad():
43
+ logits = model(**inputs).logits
44
+ pred_ids = torch.argmax(logits, dim=-1)
45
+ print(processor.batch_decode(pred_ids)[0])
46
+ ```
47
+
48
+ ## Important: text normalization
49
+
50
+ This repository contains **only the acoustic model**. The raw output is plain CTC
51
+ decoding. A separate normalization pipeline — punctuation restoration,
52
+ number-to-word expansion (with Badini-specific remapping), character
53
+ normalization, and word-variant correction — is applied in the downstream
54
+ application and is **not** included here. Output straight from this model will
55
+ not match the fully normalized transcripts.
56
+
57
+ ## Intended use
58
+
59
+ Speech transcription for Badini Kurdish. Given the WER, best used with
60
+ downstream normalization/post-processing rather than as raw final text.
added_tokens.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "</s>": 69,
3
+ "<s>": 68
4
+ }
config.json ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_dropout": 0.0,
3
+ "adapter_act": "relu",
4
+ "adapter_kernel_size": 3,
5
+ "adapter_stride": 2,
6
+ "add_adapter": true,
7
+ "apply_spec_augment": false,
8
+ "architectures": [
9
+ "Wav2Vec2BertForCTC"
10
+ ],
11
+ "attention_dropout": 0.05,
12
+ "bos_token_id": 68,
13
+ "classifier_proj_size": 768,
14
+ "codevector_dim": 768,
15
+ "conformer_conv_dropout": 0.1,
16
+ "contrastive_logits_temperature": 0.1,
17
+ "conv_depthwise_kernel_size": 31,
18
+ "ctc_loss_reduction": "mean",
19
+ "ctc_zero_infinity": true,
20
+ "diversity_loss_weight": 0.1,
21
+ "dtype": "float32",
22
+ "eos_token_id": 69,
23
+ "feat_proj_dropout": 0.0,
24
+ "feat_quantizer_dropout": 0.0,
25
+ "feature_projection_input_dim": 160,
26
+ "final_dropout": 0.1,
27
+ "hidden_act": "swish",
28
+ "hidden_dropout": 0.1,
29
+ "hidden_size": 1024,
30
+ "initializer_range": 0.02,
31
+ "intermediate_size": 4096,
32
+ "layer_norm_eps": 1e-05,
33
+ "layerdrop": 0.0,
34
+ "left_max_position_embeddings": 64,
35
+ "mask_feature_length": 10,
36
+ "mask_feature_min_masks": 0,
37
+ "mask_feature_prob": 0.0,
38
+ "mask_time_length": 10,
39
+ "mask_time_min_masks": 2,
40
+ "mask_time_prob": 0.05,
41
+ "max_source_positions": 5000,
42
+ "model_type": "wav2vec2-bert",
43
+ "num_adapter_layers": 1,
44
+ "num_attention_heads": 16,
45
+ "num_codevector_groups": 2,
46
+ "num_codevectors_per_group": 320,
47
+ "num_hidden_layers": 24,
48
+ "num_negatives": 100,
49
+ "output_hidden_size": 1024,
50
+ "pad_token_id": 67,
51
+ "position_embeddings_type": "relative_key",
52
+ "proj_codevector_dim": 768,
53
+ "right_max_position_embeddings": 8,
54
+ "rotary_embedding_base": 10000,
55
+ "tdnn_dilation": [
56
+ 1,
57
+ 2,
58
+ 3,
59
+ 1,
60
+ 1
61
+ ],
62
+ "tdnn_dim": [
63
+ 512,
64
+ 512,
65
+ 512,
66
+ 512,
67
+ 1500
68
+ ],
69
+ "tdnn_kernel": [
70
+ 5,
71
+ 3,
72
+ 3,
73
+ 1,
74
+ 1
75
+ ],
76
+ "transformers_version": "5.13.0",
77
+ "use_cache": false,
78
+ "use_intermediate_ffn_before_adapter": false,
79
+ "use_weighted_layer_sum": false,
80
+ "vocab_size": 70,
81
+ "xvector_output_dim": 512
82
+ }
evaluation_fullpunctv411.csv ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75f0c7b0ac72f483061cf97d65960e82c6543d8bb100edbcc20e09ef57d2ca7d
3
+ size 2423105760
preprocessor_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "feature_extractor_type": "SeamlessM4TFeatureExtractor",
3
+ "feature_size": 80,
4
+ "num_mel_bins": 80,
5
+ "padding_side": "right",
6
+ "padding_value": 1,
7
+ "return_attention_mask": true,
8
+ "sampling_rate": 16000,
9
+ "stride": 2
10
+ }
tokenizer_config.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "|",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "66": {
12
+ "content": "[UNK]",
13
+ "lstrip": true,
14
+ "normalized": false,
15
+ "rstrip": true,
16
+ "single_word": false,
17
+ "special": false
18
+ },
19
+ "67": {
20
+ "content": "[PAD]",
21
+ "lstrip": true,
22
+ "normalized": false,
23
+ "rstrip": true,
24
+ "single_word": false,
25
+ "special": false
26
+ },
27
+ "68": {
28
+ "content": "<s>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "69": {
36
+ "content": "</s>",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "backend": "custom",
45
+ "bos_token": "<s>",
46
+ "do_lower_case": false,
47
+ "eos_token": "</s>",
48
+ "is_local": true,
49
+ "local_files_only": false,
50
+ "model_max_length": 1000000000000000019884624838656,
51
+ "model_specific_special_tokens": {
52
+ "word_delimiter_token": "|"
53
+ },
54
+ "pad_token": "[PAD]",
55
+ "processor_class": "Wav2Vec2BertProcessor",
56
+ "replace_word_delimiter_char": " ",
57
+ "target_lang": null,
58
+ "tokenizer_class": "Wav2Vec2CTCTokenizer",
59
+ "unk_token": "[UNK]",
60
+ "word_delimiter_token": "|"
61
+ }
vocab.json ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "!": 1,
3
+ "\"": 2,
4
+ "#": 3,
5
+ "(": 4,
6
+ ")": 5,
7
+ "+": 6,
8
+ ".": 7,
9
+ ":": 8,
10
+ "=": 9,
11
+ "[PAD]": 67,
12
+ "[UNK]": 66,
13
+ "`": 10,
14
+ "|": 0,
15
+ "«": 11,
16
+ "»": 12,
17
+ "×": 13,
18
+ "ê": 14,
19
+ "î": 15,
20
+ "û": 16,
21
+ "ş": 17,
22
+ "،": 18,
23
+ "؛": 19,
24
+ "؟": 20,
25
+ "ء": 21,
26
+ "ئ": 22,
27
+ "ا": 23,
28
+ "ب": 24,
29
+ "ت": 25,
30
+ "ث": 26,
31
+ "ج": 27,
32
+ "ح": 28,
33
+ "خ": 29,
34
+ "د": 30,
35
+ "ذ": 31,
36
+ "ر": 32,
37
+ "ز": 33,
38
+ "س": 34,
39
+ "ش": 35,
40
+ "ص": 36,
41
+ "ض": 37,
42
+ "ط": 38,
43
+ "ظ": 39,
44
+ "ع": 40,
45
+ "غ": 41,
46
+ "ف": 42,
47
+ "ق": 43,
48
+ "ل": 44,
49
+ "م": 45,
50
+ "ن": 46,
51
+ "ه": 47,
52
+ "و": 48,
53
+ "پ": 49,
54
+ "چ": 50,
55
+ "ڕ": 51,
56
+ "ژ": 52,
57
+ "ڤ": 53,
58
+ "ک": 54,
59
+ "گ": 55,
60
+ "ڵ": 56,
61
+ "ۆ": 57,
62
+ "ی": 58,
63
+ "ێ": 59,
64
+ "ە": 60,
65
+ "ݒ": 61,
66
+ "ݘ": 62,
67
+ "ݵ": 63,
68
+ "❝": 64,
69
+ "❞": 65
70
+ }