Class: Whisper::Segment
- Inherits:
-
Object
- Object
- Whisper::Segment
- Includes:
- Output::Segment
- Defined in:
- sig/whisper.rbs
Instance Method Summary collapse
-
#deconstruct_keys ⇒ deconstructed_keys
Possible keys:
:start_time,:end_time,:text,:no_speech_prob,:speaker_turn_next. -
#each_token {|arg0| ... } ⇒ Object
Yields each Whisper::Token:.
-
#end_time ⇒ Integer
End time in milliseconds.
-
#n_tokens ⇒ Integer
Get number of tokens in the segment.
- #no_speech_prob ⇒ Float
-
#speaker_turn_next? ⇒ true, false
Whether the next segment is predicted as a speaker turn.
-
#start_time ⇒ Integer
Start time in milliseconds.
- #text ⇒ String
Methods included from Output::Segment
Instance Method Details
#deconstruct_keys ⇒ deconstructed_keys
Possible keys: :start_time, :end_time, :text, :no_speech_prob, :speaker_turn_next
whisper.each_segment do |segment|
segment => {start_time:, end_time:, text:, no_speech_prob:, speaker_turn_next:}
puts "[#{start_time} --> #{end_time}] #{text} (no speech prob: #{no_speech_prob}#{speaker_turn_next ? ', speaker turns next' : ''})"
end
547 |
# File 'sig/whisper.rbs', line 547
def deconstruct_keys: (Array[:start_time | :end_time | :text | :no_speech_prob | :speaker_turn_next | :n_tokens] | nil) -> deconstructed_keys
|
#each_token ⇒ void #each_token ⇒ Enumerator[Token]
Yields each Whisper::Token:
whisper.each_segment.first.each_token do |token|
p token
end
Returns an Enumerator if no block is given:
whisper.each_segment.first.each_token.to_a # => [#<Whisper::Token>, ...]
537 538 |
# File 'sig/whisper.rbs', line 537
def each_token: { (Token) -> void } -> void
| () -> Enumerator[Token]
|
#end_time ⇒ Integer
End time in milliseconds.
514 |
# File 'sig/whisper.rbs', line 514
def end_time: () -> Integer
|
#n_tokens ⇒ Integer
Get number of tokens in the segment
525 |
# File 'sig/whisper.rbs', line 525
def n_tokens: () -> Integer
|
#no_speech_prob ⇒ Float
521 |
# File 'sig/whisper.rbs', line 521
def no_speech_prob: () -> Float
|
#speaker_turn_next? ⇒ true, false
Whether the next segment is predicted as a speaker turn.
518 |
# File 'sig/whisper.rbs', line 518
def speaker_turn_next?: () -> (true | false)
|
#start_time ⇒ Integer
Start time in milliseconds.
510 |
# File 'sig/whisper.rbs', line 510
def start_time: () -> Integer
|
#text ⇒ String
520 |
# File 'sig/whisper.rbs', line 520
def text: () -> String
|