Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CHiME4 recipe #746

Merged
merged 9 commits into from
Nov 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
commit missing changes
  • Loading branch information
funcwj committed Nov 18, 2021
commit 958621c18aa31a790823f31f768d93b9b6c8dd2b
3 changes: 2 additions & 1 deletion wenet/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ def Dataset(data_type, data_list_file, symbol_table, conf,
else:
dataset = Processor(dataset, processor.parse_raw)

dataset = Processor(dataset, processor.tokenize, symbol_table, bpe_model, conf.get('char', False))
dataset = Processor(dataset, processor.tokenize, symbol_table, \
bpe_model, conf.get('split_with_space', False))
filter_conf = conf.get('filter_conf', {})
dataset = Processor(dataset, processor.filter, **filter_conf)

Expand Down
4 changes: 2 additions & 2 deletions wenet/dataset/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def compute_fbank(data,
yield dict(key=sample['key'], label=sample['label'], feat=mat)


def tokenize(data, symbol_table, bpe_model=None, char=False):
def tokenize(data, symbol_table, bpe_model=None, split_with_space=False):
""" Decode text to chars or BPE
Inplace operation

Expand Down Expand Up @@ -289,7 +289,7 @@ def tokenize(data, symbol_table, bpe_model=None, char=False):
for l in sp.encode_as_pieces(k):
tokens.append(l)
else:
if char:
if split_with_space:
txt = txt.split(" ")
for ch in txt:
tokens.append(ch)
Expand Down