Class: OCI::AiSpeech::Models::TranscriptionModelDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/ai_speech/models/transcription_model_details.rb

Overview

Model details.

Constant Summary collapse

DOMAIN_ENUM =
[
  DOMAIN_GENERIC = 'GENERIC'.freeze,
  DOMAIN_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LANGUAGE_CODE_ENUM =
[
  LANGUAGE_CODE_EN_US = 'en-US'.freeze,
  LANGUAGE_CODE_ES_ES = 'es-ES'.freeze,
  LANGUAGE_CODE_PT_BR = 'pt-BR'.freeze,
  LANGUAGE_CODE_EN_GB = 'en-GB'.freeze,
  LANGUAGE_CODE_EN_AU = 'en-AU'.freeze,
  LANGUAGE_CODE_EN_IN = 'en-IN'.freeze,
  LANGUAGE_CODE_HI_IN = 'hi-IN'.freeze,
  LANGUAGE_CODE_FR_FR = 'fr-FR'.freeze,
  LANGUAGE_CODE_DE_DE = 'de-DE'.freeze,
  LANGUAGE_CODE_IT_IT = 'it-IT'.freeze,
  LANGUAGE_CODE_AUTO = 'auto'.freeze,
  LANGUAGE_CODE_AF = 'af'.freeze,
  LANGUAGE_CODE_AR = 'ar'.freeze,
  LANGUAGE_CODE_AZ = 'az'.freeze,
  LANGUAGE_CODE_BE = 'be'.freeze,
  LANGUAGE_CODE_BG = 'bg'.freeze,
  LANGUAGE_CODE_BS = 'bs'.freeze,
  LANGUAGE_CODE_CA = 'ca'.freeze,
  LANGUAGE_CODE_CS = 'cs'.freeze,
  LANGUAGE_CODE_CY = 'cy'.freeze,
  LANGUAGE_CODE_DA = 'da'.freeze,
  LANGUAGE_CODE_DE = 'de'.freeze,
  LANGUAGE_CODE_EL = 'el'.freeze,
  LANGUAGE_CODE_EN = 'en'.freeze,
  LANGUAGE_CODE_ES = 'es'.freeze,
  LANGUAGE_CODE_ET = 'et'.freeze,
  LANGUAGE_CODE_FA = 'fa'.freeze,
  LANGUAGE_CODE_FI = 'fi'.freeze,
  LANGUAGE_CODE_FR = 'fr'.freeze,
  LANGUAGE_CODE_GL = 'gl'.freeze,
  LANGUAGE_CODE_HE = 'he'.freeze,
  LANGUAGE_CODE_HI = 'hi'.freeze,
  LANGUAGE_CODE_HR = 'hr'.freeze,
  LANGUAGE_CODE_HU = 'hu'.freeze,
  LANGUAGE_CODE_HY = 'hy'.freeze,
  LANGUAGE_CODE_ID = 'id'.freeze,
  LANGUAGE_CODE_IS = 'is'.freeze,
  LANGUAGE_CODE_IT = 'it'.freeze,
  LANGUAGE_CODE_JA = 'ja'.freeze,
  LANGUAGE_CODE_KK = 'kk'.freeze,
  LANGUAGE_CODE_KN = 'kn'.freeze,
  LANGUAGE_CODE_KO = 'ko'.freeze,
  LANGUAGE_CODE_LT = 'lt'.freeze,
  LANGUAGE_CODE_LV = 'lv'.freeze,
  LANGUAGE_CODE_MI = 'mi'.freeze,
  LANGUAGE_CODE_MK = 'mk'.freeze,
  LANGUAGE_CODE_MR = 'mr'.freeze,
  LANGUAGE_CODE_MS = 'ms'.freeze,
  LANGUAGE_CODE_NE = 'ne'.freeze,
  LANGUAGE_CODE_NL = 'nl'.freeze,
  LANGUAGE_CODE_NO = 'no'.freeze,
  LANGUAGE_CODE_PL = 'pl'.freeze,
  LANGUAGE_CODE_PT = 'pt'.freeze,
  LANGUAGE_CODE_RO = 'ro'.freeze,
  LANGUAGE_CODE_RU = 'ru'.freeze,
  LANGUAGE_CODE_SK = 'sk'.freeze,
  LANGUAGE_CODE_SL = 'sl'.freeze,
  LANGUAGE_CODE_SR = 'sr'.freeze,
  LANGUAGE_CODE_SV = 'sv'.freeze,
  LANGUAGE_CODE_SW = 'sw'.freeze,
  LANGUAGE_CODE_TA = 'ta'.freeze,
  LANGUAGE_CODE_TH = 'th'.freeze,
  LANGUAGE_CODE_TL = 'tl'.freeze,
  LANGUAGE_CODE_TR = 'tr'.freeze,
  LANGUAGE_CODE_UK = 'uk'.freeze,
  LANGUAGE_CODE_UR = 'ur'.freeze,
  LANGUAGE_CODE_VI = 'vi'.freeze,
  LANGUAGE_CODE_ZH = 'zh'.freeze,
  LANGUAGE_CODE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TranscriptionModelDetails

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/oci/ai_speech/models/transcription_model_details.rb', line 214

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.model_type = attributes[:'modelType'] if attributes[:'modelType']
  self.model_type = "ORACLE" if model_type.nil? && !attributes.key?(:'modelType') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :modelType and :model_type' if attributes.key?(:'modelType') && attributes.key?(:'model_type')

  self.model_type = attributes[:'model_type'] if attributes[:'model_type']
  self.model_type = "ORACLE" if model_type.nil? && !attributes.key?(:'modelType') && !attributes.key?(:'model_type') # rubocop:disable Style/StringLiterals

  self.domain = attributes[:'domain'] if attributes[:'domain']
  self.domain = "GENERIC" if domain.nil? && !attributes.key?(:'domain') # rubocop:disable Style/StringLiterals

  self.language_code = attributes[:'languageCode'] if attributes[:'languageCode']
  self.language_code = "en-US" if language_code.nil? && !attributes.key?(:'languageCode') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :languageCode and :language_code' if attributes.key?(:'languageCode') && attributes.key?(:'language_code')

  self.language_code = attributes[:'language_code'] if attributes[:'language_code']
  self.language_code = "en-US" if language_code.nil? && !attributes.key?(:'languageCode') && !attributes.key?(:'language_code') # rubocop:disable Style/StringLiterals

  self.transcription_settings = attributes[:'transcriptionSettings'] if attributes[:'transcriptionSettings']

  raise 'You cannot provide both :transcriptionSettings and :transcription_settings' if attributes.key?(:'transcriptionSettings') && attributes.key?(:'transcription_settings')

  self.transcription_settings = attributes[:'transcription_settings'] if attributes[:'transcription_settings']
end

Instance Attribute Details

#domainString

Domain for input files.

Returns:

  • (String)


99
100
101
# File 'lib/oci/ai_speech/models/transcription_model_details.rb', line 99

def domain
  @domain
end

#language_codeString

Oracle supported language codes are (Oracle models are locale specific). - en-US: English - United States (default) - es-ES: Spanish - Spain - pt-BR: Portuguese - Brazil - en-GB: English - Great Britain - en-AU: English - Australia - en-IN: English - India - hi-IN: Hindi - India - fr-FR: French - France - de-DE: German - Germany - it-IT: Italian - Italy

Whisper supported language codes are (Whisper models are locale agnostic). - auto: Auto-detect language - af: Afrikaans - ar: Arabic - az: Azerbaijani - be: Belarusian - bg: Bulgarian - bs: Bosnian - ca: Catalan - cs: Czech - cy: Welsh - da: Danish - de: German - el: Greek - en: English (default) - es: Spanish - et: Estonian - fa: Persian - fi: Finnish - fr: French - gl: Galician - he: Hebrew - hi: Hindi - hr: Croatian - hu: Hungarian - hy: Armenian - id: Indonesian - is: Icelandic - it: Italian - ja: Japanese - kk: Kazakh - kn: Kannada - ko: Korean - lt: Lithuanian - lv: Latvian - mi: Maori - mk: Macedonian - mr: Marathi - ms: Malay - ne: Nepali - nl: Dutch - no: Norwegian - pl: Polish - pt: Portuguese - ro: Romanian - ru: Russian - sk: Slovak - sl: Slovenian - sr: Serbian - sv: Swedish - sw: Swahili - ta: Tamil - th: Thai - tl: Tagalog - tr: Turkish - uk: Ukrainian - ur: Urdu - vi: Vietnamese - zh: Chinese

Returns:

  • (String)


175
176
177
# File 'lib/oci/ai_speech/models/transcription_model_details.rb', line 175

def language_code
  @language_code
end

#model_typeString

Select a model to use for generating transcriptions. Currently supported models are: - ORACLE - WHISPER_MEDIUM - WHISPER_LARGE_V2 (upon service request)

Returns:

  • (String)


95
96
97
# File 'lib/oci/ai_speech/models/transcription_model_details.rb', line 95

def model_type
  @model_type
end

#transcription_settingsOCI::AiSpeech::Models::TranscriptionSettings



178
179
180
# File 'lib/oci/ai_speech/models/transcription_model_details.rb', line 178

def transcription_settings
  @transcription_settings
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



181
182
183
184
185
186
187
188
189
190
# File 'lib/oci/ai_speech/models/transcription_model_details.rb', line 181

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'model_type': :'modelType',
    'domain': :'domain',
    'language_code': :'languageCode',
    'transcription_settings': :'transcriptionSettings'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



193
194
195
196
197
198
199
200
201
202
# File 'lib/oci/ai_speech/models/transcription_model_details.rb', line 193

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'model_type': :'String',
    'domain': :'String',
    'language_code': :'String',
    'transcription_settings': :'OCI::AiSpeech::Models::TranscriptionSettings'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



279
280
281
282
283
284
285
286
287
# File 'lib/oci/ai_speech/models/transcription_model_details.rb', line 279

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    model_type == other.model_type &&
    domain == other.domain &&
    language_code == other.language_code &&
    transcription_settings == other.transcription_settings
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/oci/ai_speech/models/transcription_model_details.rb', line 312

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


292
293
294
# File 'lib/oci/ai_speech/models/transcription_model_details.rb', line 292

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



301
302
303
# File 'lib/oci/ai_speech/models/transcription_model_details.rb', line 301

def hash
  [model_type, domain, language_code, transcription_settings].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



345
346
347
348
349
350
351
352
353
354
# File 'lib/oci/ai_speech/models/transcription_model_details.rb', line 345

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



339
340
341
# File 'lib/oci/ai_speech/models/transcription_model_details.rb', line 339

def to_s
  to_hash.to_s
end