mindsdb/mindsdb_python_sdk

Predict from dict

ea-rus opened this issue · 0 comments

ea-rus commented

Add feature to pass dict to 'predict' method of the model. It should be equivalent of the one line prediction.
And the result should be also one row dict.

project = server.get_project()
model = project.get_model('model_name')

result = mdb.predict({"text": 'any text'})
print(result)
> {'sentiment': 'positive'}