Classes | |
| class | Mimic2 |
| class | Mimic2Validator |
Functions | |
| def | _add_punctuation (text) |
| def | _break_chunks (l, n) |
| def | _sentence_chunker (text) |
| def | _split_by_chunk_size (text, chunk_size) |
| def | _split_by_punctuation (chunks, puncs) |
Variables | |
| int | _max_sentence_size = 170 |
|
private |
Add punctuation at the end of each chunk. Mimic2 expects some form of punctuation at the end of a sentence.
Definition at line 115 of file mimic2_tts.py.
|
private |
Yield successive n-sized chunks
Args:
l (list): text (str) to split
chunk_size (int): chunk size
Definition at line 40 of file mimic2_tts.py.
|
private |
Split text into smaller chunks for TTS generation.
NOTE: The smaller chunks are needed due to current Mimic2 TTS limitations.
This stage can be removed once Mimic2 can generate longer sentences.
Args:
text (str): text to split
chunk_size (int): size of each chunk
split_by_punc (bool, optional): Defaults to True.
Returns:
list: list of text chunks
Definition at line 127 of file mimic2_tts.py.
|
private |
Split text into word chunks by chunk_size size
Args:
text (str): text to split
chunk_size (int): chunk size
Returns:
list: list of text chunks
Definition at line 51 of file mimic2_tts.py.
|
private |
splits text by various punctionations
e.g. hello, world => [hello, world]
Args:
chunks (list or str): text (str) to split
puncs (list): list of punctuations used to split text
Returns:
list: list with split text
Definition at line 88 of file mimic2_tts.py.
|
private |
Definition at line 37 of file mimic2_tts.py.