WordInterval#

class montreal_forced_aligner.db.WordInterval(**kwargs)[source]#

Bases: Base

Database class for storing information about aligned word intervals

Parameters:
  • id (int) – Primary key

  • begin (float) – Beginning timestamp of the interval

  • end (float) – Ending timestamp of the interval

  • word_id (int) – Foreign key to Word

  • word (Word) – Word of the interval

  • pronunciation_id (int) – Foreign key to Pronunciation

  • pronunciation (Pronunciation) – Pronunciation of the word

  • utterance_id (int) – Foreign key to Utterance

  • utterance (Utterance) – Utterance of the interval

  • workflow_id (int) – Foreign key to CorpusWorkflow

  • workflow (CorpusWorkflow) – Workflow that generated the interval

  • phone_intervals (list[PhoneInterval]) – Phone intervals for the word interval

as_ctm()[source]#

Generate a CtmInterval from the database object

Returns:

CTM interval object

Return type:

CtmInterval

classmethod from_ctm(interval, utterance, workflow_id)[source]#

Construct a WordInterval from a CtmInterval object

Parameters:
  • interval (CtmInterval) – CtmInterval containing data for the word interval

  • utterance (Utterance) – Utterance object that the word interval belongs to

  • workflow_id (int) – Integer id for the workflow that generated the phone interval

Returns:

Word interval object

Return type:

WordInterval