annotations.FillIPUs package¶
Submodules¶
annotations.FillIPUs.fillipus module¶
- filename
sppas.src.annotations.FillIPUs.fillipus.py
- author
Brigitte Bigi
- contact
- summary
Search for IPUS and fill in IPUs with a given transcription.
- class annotations.FillIPUs.fillipus.FillIPUs(channel, units)[source]¶
Bases:
annotations.SearchIPUs.searchipus.SearchIPUs
Search for IPUs and fill in the IPUs with a transcription.
- __init__(channel, units)[source]¶
Instantiate.
- Parameters
channel – (sppasChannel)
units – (list of str) All units to fill.
The given units can be either ipus+silences or ipus only.
- fix_threshold_durations()[source]¶
Search appropriate parameters to match the units and the channel.
Try various volume values, pause durations and silence duration to search silences then tracks. Stops when the number of tracks automatically found is matching the number of given units.
- Returns
tracks
annotations.FillIPUs.sppasfillipus module¶
- filename
sppas.src.annotations.FillIPUs.sppasfillipus.py
- author
Brigitte Bigi
- contact
- summary
Search for IPUS and fill in IPUs with a given transcription.
- class annotations.FillIPUs.sppasfillipus.sppasFillIPUs(log=None)[source]¶
Bases:
annotations.baseannot.sppasBaseAnnotation
SPPAS integration of the fill in IPUs automatic annotation.
- __init__(log=None)[source]¶
Create a new sppasFillIPUs instance.
Log is used for a better communication of the annotation process and its results. If None, logs are redirected to the default logging system.
- Parameters
log – (sppasLog) Human-readable logs.
- convert(channel, text_tier)[source]¶
Return a tier with transcription aligned to the audio.
- Parameters
channel – (sppasChannel) Input audio channel
text_tier – (sppasTier) Input transcription text in a PointTier
- fix_options(options)[source]¶
Fix all options.
Available options are:
threshold: volume threshold to decide a window is silence or not
win_length: length of window for a estimation or volume values
min_sil: minimum duration of a silence
min_ipu: minimum duration of an ipu
shift_start: start boundary shift value.
shift_end: end boundary shift value.
- Parameters
options – (sppasOption)
- static get_input_extensions()[source]¶
Extensions that the annotation expects for its input filename.
- get_inputs(input_files)[source]¶
Return the channel and the tier with ipus.
- Parameters
input_files – (list)
- Raise
NoTierInputError
- Returns
(sppasChannel, sppasTier)
- run(input_files, output=None)[source]¶
Run the automatic annotation process on an input.
input_filename is a tuple (audio, raw transcription)
- Parameters
input_files – (list of str) (audio, ortho)
output – (str) the output file name
- Returns
(sppasTranscription)
- run_for_batch_processing(input_files)[source]¶
Perform the annotation on a file.
This method is called by ‘batch_processing’. It fixes the name of the output file, and call the run method.
Override to NOT ANNOTATE if an annotation is already existing.
- Parameters
input_files – (list of str) the required inputs for a run
- Returns
output file name or None
- set_min_ipu(value)[source]¶
Fix the initial minimum duration of an IPU.
- Parameters
value – (float) Duration in seconds.
- set_min_sil(value)[source]¶
Fix the initial minimum duration of a silence.
- Parameters
value – (float) Duration in seconds.
Module contents¶
- filename
sppas.src.annotations.FillIPUs.__init__.py
- author
Brigitte Bigi
- contact
- summary
Fill in IPUs automatic annotation.
- class annotations.FillIPUs.FillIPUs(channel, units)[source]¶
Bases:
annotations.SearchIPUs.searchipus.SearchIPUs
Search for IPUs and fill in the IPUs with a transcription.
- __init__(channel, units)[source]¶
Instantiate.
- Parameters
channel – (sppasChannel)
units – (list of str) All units to fill.
The given units can be either ipus+silences or ipus only.
- fix_threshold_durations()[source]¶
Search appropriate parameters to match the units and the channel.
Try various volume values, pause durations and silence duration to search silences then tracks. Stops when the number of tracks automatically found is matching the number of given units.
- Returns
tracks
- class annotations.FillIPUs.sppasFillIPUs(log=None)[source]¶
Bases:
annotations.baseannot.sppasBaseAnnotation
SPPAS integration of the fill in IPUs automatic annotation.
- __init__(log=None)[source]¶
Create a new sppasFillIPUs instance.
Log is used for a better communication of the annotation process and its results. If None, logs are redirected to the default logging system.
- Parameters
log – (sppasLog) Human-readable logs.
- convert(channel, text_tier)[source]¶
Return a tier with transcription aligned to the audio.
- Parameters
channel – (sppasChannel) Input audio channel
text_tier – (sppasTier) Input transcription text in a PointTier
- fix_options(options)[source]¶
Fix all options.
Available options are:
threshold: volume threshold to decide a window is silence or not
win_length: length of window for a estimation or volume values
min_sil: minimum duration of a silence
min_ipu: minimum duration of an ipu
shift_start: start boundary shift value.
shift_end: end boundary shift value.
- Parameters
options – (sppasOption)
- static get_input_extensions()[source]¶
Extensions that the annotation expects for its input filename.
- get_inputs(input_files)[source]¶
Return the channel and the tier with ipus.
- Parameters
input_files – (list)
- Raise
NoTierInputError
- Returns
(sppasChannel, sppasTier)
- run(input_files, output=None)[source]¶
Run the automatic annotation process on an input.
input_filename is a tuple (audio, raw transcription)
- Parameters
input_files – (list of str) (audio, ortho)
output – (str) the output file name
- Returns
(sppasTranscription)
- run_for_batch_processing(input_files)[source]¶
Perform the annotation on a file.
This method is called by ‘batch_processing’. It fixes the name of the output file, and call the run method.
Override to NOT ANNOTATE if an annotation is already existing.
- Parameters
input_files – (list of str) the required inputs for a run
- Returns
output file name or None
- set_min_ipu(value)[source]¶
Fix the initial minimum duration of an IPU.
- Parameters
value – (float) Duration in seconds.
- set_min_sil(value)[source]¶
Fix the initial minimum duration of a silence.
- Parameters
value – (float) Duration in seconds.