professional-machine-learning-engineer question 56 discussion

View all Professional Machine Learning Engineer here
back to google forum

Question 56

You trained a text classification model. You have the following SignatureDefs:

You started a TensorFlow-serving component server and tried to send an HTTP request to get a prediction using:
headers = {"content-type": "application/json"}
json_response = requests.post('http: //localhost:8501/v1/models/text_model:predict', data=data, headers=headers)
What is the correct way to write the predict request?

  • A. data = json.dumps({“signature_name”: “seving_default”, “instances” [[‘ab’, ‘bc’, ‘cd’]]})
  • B. data = json.dumps({“signature_name”: “serving_default”, “instances” [[‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’]]})
  • C. data = json.dumps({“signature_name”: “serving_default”, “instances” [[‘a’, ‘b’, ‘c’], [‘d’, ‘e’, ‘f’]]})
  • D. data = json.dumps({“signature_name”: “serving_default”, “instances” [[‘a’, ‘b’], [‘c’, ‘d’], [‘e’, ‘f’]]})
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%
Discussions
0 / 1000
Jane
4 months, 2 weeks ago

represents a vector with any number of rows but only 2 Columns