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

Feature/add phonemizer metadata #125

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

tanujjain
Copy link

@tanujjain tanujjain commented Jan 19, 2022

  • Accepts phonemized data for training and prediction by adding additional cardinality to phoneme_language flag in training_config.yaml
  • Removes skip_phonemization flag since it was unused
  • Updates symbol list to include wiktionary ipa annotations

Copy link
Collaborator

@cschaefer26 cschaefer26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the script could be simplified.

test_metadata_path = cm.valid_metadata_path
print(f'\nReading metadata from {metadatareader.metadata_path}')
print(f'\nFound {len(metadatareader.filenames)} lines.')
def get_short_files(phonemized=False):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type hints missing.

print(f'\nReading metadata from {metadatareader.metadata_path}')
print(f'\nFound {len(metadatareader.filenames)} lines.')
def get_short_files(phonemized=False):
if not phonemized:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if not phonemized:
symbol_list = all_phonemes if phonemized else _alphabet

return filter_metadata


remove_files = pickle.load(open(cm.data_dir / 'under-over_sized_mels.pkl', 'rb'))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unclosed fileio

remove_files = pickle.load(open(cm.data_dir / 'under-over_sized_mels.pkl', 'rb'))
phonemized_metadata_path = cm.phonemized_metadata_path
train_metadata_path = cm.train_metadata_path
test_metadata_path = cm.valid_metadata_path
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inconsistent naming of train and validation


new_metadata = [f'{k}|{v}\n' for k, v in phonemized_data.items()]
shuffled_metadata = np.random.permutation(new_metadata)
train_metadata = shuffled_metadata[0:train_len]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
train_metadata = shuffled_metadata[0:train_len]
train_metadata = shuffled_metadata[0:-test_len]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its safer to just use the test_len, also it saves a couple of lines

file.writelines(test_metadata)

# some checks
assert metadata_len == len(set(list(phonemized_data.keys()))), \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert metadata_len == len(set(list(phonemized_data.keys()))), \
assert metadata_len == len(phonemized_data)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for the other dict keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants