Module: TensorFlow::Keras::Datasets::IMDB

Defined in:
lib/tensorflow/keras/datasets/imdb.rb

Class Method Summary collapse

Class Method Details

.get_word_index(path: "imdb_word_index.json") ⇒ Object

x_train = data

labels_train = data["y_train"]
x_test = data["x_test"]
labels_test = data["y_test"]

end



19
20
21
22
23
24
25
26
# File 'lib/tensorflow/keras/datasets/imdb.rb', line 19

def self.get_word_index(path: "imdb_word_index.json")
  file = Utils.get_file(
    path,
    "https://storage.googleapis.com/tensorflow/tf-keras-datasets/imdb_word_index.json",
    file_hash: "bfafd718b763782e994055a2d397834f"
  )
  JSON.parse(File.read(file))
end