Class: Cohere::Transcribe::Runtime::WordPipeline::AlignmentWork
- Inherits:
-
Data
- Object
- Data
- Cohere::Transcribe::Runtime::WordPipeline::AlignmentWork
- 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
-
#audio_required ⇒ Object
readonly
Returns the value of attribute audio_required.
-
#decode_backend ⇒ Object
readonly
Returns the value of attribute decode_backend.
-
#entry ⇒ Object
readonly
Returns the value of attribute entry.
-
#expected_sample_count ⇒ Object
readonly
Returns the value of attribute expected_sample_count.
-
#generation_id ⇒ Object
readonly
Returns the value of attribute generation_id.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#plan ⇒ Object
readonly
Returns the value of attribute plan.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#segment_times ⇒ Object
readonly
Returns the value of attribute segment_times.
-
#source_snapshot ⇒ Object
readonly
Returns the value of attribute source_snapshot.
-
#speech_spans ⇒ Object
readonly
Returns the value of attribute speech_spans.
Instance Method Summary collapse
-
#initialize(index:, entry:, plan:, result:, segment_times:, speech_spans:, generation_id:, decode_backend:, expected_sample_count:, audio_required:, source_snapshot:) ⇒ AlignmentWork
constructor
A new instance of AlignmentWork.
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.
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_required ⇒ Object (readonly)
Returns the value of attribute audio_required
16 17 18 |
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16 def audio_required @audio_required end |
#decode_backend ⇒ Object (readonly)
Returns the value of attribute decode_backend
16 17 18 |
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16 def decode_backend @decode_backend end |
#entry ⇒ Object (readonly)
Returns the value of attribute entry
16 17 18 |
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16 def entry @entry end |
#expected_sample_count ⇒ Object (readonly)
Returns the value of attribute 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_id ⇒ Object (readonly)
Returns the value of attribute generation_id
16 17 18 |
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16 def generation_id @generation_id end |
#index ⇒ Object (readonly)
Returns the value of attribute index
16 17 18 |
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16 def index @index end |
#plan ⇒ Object (readonly)
Returns the value of attribute plan
16 17 18 |
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16 def plan @plan end |
#result ⇒ Object (readonly)
Returns the value of attribute result
16 17 18 |
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16 def result @result end |
#segment_times ⇒ Object (readonly)
Returns the value of attribute segment_times
16 17 18 |
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16 def segment_times @segment_times end |
#source_snapshot ⇒ Object (readonly)
Returns the value of attribute source_snapshot
16 17 18 |
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16 def source_snapshot @source_snapshot end |
#speech_spans ⇒ Object (readonly)
Returns the value of attribute speech_spans
16 17 18 |
# File 'lib/cohere/transcribe/runtime/word_pipeline.rb', line 16 def speech_spans @speech_spans end |