Class: Cohere::Transcribe::Runtime::WordPipeline::AlignmentWork

Inherits:
Data
  • Object
show all
Defined in:
lib/cohere/transcribe/runtime/word_pipeline.rb

Overview

The complete state needed after ASR. Deliberately absent are decoded samples (or a decoder result): multi-file word mode must re-decode one source at a time instead of retaining every waveform until alignment.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index:, entry:, plan:, result:, segment_times:, speech_spans:, generation_id:, decode_backend:, expected_sample_count:, audio_required:, source_snapshot:) ⇒ AlignmentWork

Returns a new instance of AlignmentWork.

Raises:

  • (ArgumentError)


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 29

def initialize(index:, entry:, plan:, result:, segment_times:, speech_spans:,
               generation_id:, decode_backend:, expected_sample_count:, audio_required:,
               source_snapshot:)
  index = Integer(index)
  expected_sample_count = Integer(expected_sample_count)
  raise ArgumentError, "word-pipeline index must be nonnegative" if index.negative?
  raise ArgumentError, "expected alignment sample count must be nonnegative" if expected_sample_count.negative?

  super(
    index: index,
    entry: entry,
    plan: plan,
    result: result,
    segment_times: immutable_spans(segment_times, "segment_times"),
    speech_spans: immutable_spans(speech_spans, "speech_spans"),
    generation_id: immutable_optional_string(generation_id),
    decode_backend: immutable_optional_string(decode_backend),
    expected_sample_count: expected_sample_count,
    audio_required: !!audio_required,
    source_snapshot: immutable_snapshot(source_snapshot)
  )
end

Instance Attribute Details

#audio_requiredObject (readonly)

Returns the value of attribute audio_required

Returns:

  • (Object)

    the current value of audio_required



16
17
18
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16

def audio_required
  @audio_required
end

#decode_backendObject (readonly)

Returns the value of attribute decode_backend

Returns:

  • (Object)

    the current value of decode_backend



16
17
18
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16

def decode_backend
  @decode_backend
end

#entryObject (readonly)

Returns the value of attribute entry

Returns:

  • (Object)

    the current value of entry



16
17
18
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16

def entry
  @entry
end

#expected_sample_countObject (readonly)

Returns the value of attribute expected_sample_count

Returns:

  • (Object)

    the current value of expected_sample_count



16
17
18
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16

def expected_sample_count
  @expected_sample_count
end

#generation_idObject (readonly)

Returns the value of attribute generation_id

Returns:

  • (Object)

    the current value of generation_id



16
17
18
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16

def generation_id
  @generation_id
end

#indexObject (readonly)

Returns the value of attribute index

Returns:

  • (Object)

    the current value of index



16
17
18
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16

def index
  @index
end

#planObject (readonly)

Returns the value of attribute plan

Returns:

  • (Object)

    the current value of plan



16
17
18
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16

def plan
  @plan
end

#resultObject (readonly)

Returns the value of attribute result

Returns:

  • (Object)

    the current value of result



16
17
18
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16

def result
  @result
end

#segment_timesObject (readonly)

Returns the value of attribute segment_times

Returns:

  • (Object)

    the current value of segment_times



16
17
18
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16

def segment_times
  @segment_times
end

#source_snapshotObject (readonly)

Returns the value of attribute source_snapshot

Returns:

  • (Object)

    the current value of source_snapshot



16
17
18
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16

def source_snapshot
  @source_snapshot
end

#speech_spansObject (readonly)

Returns the value of attribute speech_spans

Returns:

  • (Object)

    the current value of speech_spans



16
17
18
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16

def speech_spans
  @speech_spans
end