Skip to content

Commit

Permalink
docs(SpeechToTextV1): Update API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Oliveri committed Nov 2, 2018
1 parent 561bcf5 commit 54d1cca
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ public struct SpeechRecognitionAlternative: Decodable {
public var transcript: String

/**
A score that indicates the service's confidence in the transcript in the range of 0.0 to 1.0. Returned only for the
best alternative and only with results marked as final.
A score that indicates the service's confidence in the transcript in the range of 0.0 to 1.0. A confidence score is
returned only for the best alternative and only with results marked as final.
*/
public var confidence: Double?

/**
Time alignments for each word from the transcript as a list of lists. Each inner list consists of three elements:
the word followed by its start and end time in seconds, for example: `[["hello",0.0,1.2],["world",1.2,2.5]]`.
Returned only for the best alternative.
Timestamps are returned only for the best alternative.
*/
public var timestamps: [WordTimestamp]?

/**
A confidence score for each word of the transcript as a list of lists. Each inner list consists of two elements:
the word and its confidence score in the range of 0.0 to 1.0, for example: `[["hello",0.95],["world",0.866]]`.
Returned only for the best alternative and only with results marked as final.
Confidence scores are returned only for the best alternative and only with results marked as final.
*/
public var wordConfidence: [WordConfidence]?

Expand Down
15 changes: 8 additions & 7 deletions Source/SpeechToTextV1/Models/SpeechRecognitionResults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import Foundation
public struct SpeechRecognitionResults: Decodable {

/**
An array that can include interim and final results (interim results are returned only if supported by the method).
Final results are guaranteed not to change; interim results might be replaced by further interim results and final
results. The service periodically sends updates to the results list; the `result_index` is set to the lowest index
in the array that has changed; it is incremented for new results.
An array of `SpeechRecognitionResult` objects that can include interim and final results (interim results are
returned only if supported by the method). Final results are guaranteed not to change; interim results might be
replaced by further interim results and final results. The service periodically sends updates to the results list;
the `result_index` is set to the lowest index in the array that has changed; it is incremented for new results.
*/
public var results: [SpeechRecognitionResult]?

Expand All @@ -34,9 +34,10 @@ public struct SpeechRecognitionResults: Decodable {
public var resultIndex: Int?

/**
An array that identifies which words were spoken by which speakers in a multi-person exchange. Returned in the
response only if `speaker_labels` is `true`. When interim results are also requested for methods that support them,
it is possible for a `SpeechRecognitionResults` object to include only the `speaker_labels` field.
An array of `SpeakerLabelsResult` objects that identifies which words were spoken by which speakers in a
multi-person exchange. The array is returned only if the `speaker_labels` parameter is `true`. When interim results
are also requested for methods that support them, it is possible for a `SpeechRecognitionResults` object to include
only the `speaker_labels` field.
*/
public var speakerLabels: [SpeakerLabelsResult]?

Expand Down
Loading

0 comments on commit 54d1cca

Please sign in to comment.