Class: Clarification::TrainRequester

Inherits:
Requester
  • Object
show all
Defined in:
lib/clarification/requester/train_requester.rb

Instance Method Summary collapse

Methods inherited from Requester

#get, #initialize

Constructor Details

This class inherits a constructor from Clarification::Requester

Instance Method Details

#add_image_with_concepts(target_url, concept_array) ⇒ Object


4
5
6
7
8
9
# File 'lib/clarification/requester/train_requester.rb', line 4

def add_image_with_concepts(target_url, concept_array)
  uri = uri_builder("inputs")
  body = image_with_concepts_body_builder(target_url, concept_array)
  response = get_response(uri, body)
  return response.body
end

#create_model(name, concept_array) ⇒ Object


11
12
13
14
15
16
# File 'lib/clarification/requester/train_requester.rb', line 11

def create_model(name, concept_array)
  uri = uri_builder("models")
  body = create_model_body_builder(name, concept_array)
  response = get_response(uri, body)
  return response.body
end

#train_model(id) ⇒ Object


18
19
20
21
22
23
# File 'lib/clarification/requester/train_requester.rb', line 18

def train_model(id)
  uri = uri_builder("models/#{id}/versions")
  body = {}
  response = get_response(uri, body)
  return response.body
end