ium_434804/pred_from_model.py
2021-05-23 15:44:11 +02:00

12 lines
334 B
Python

import json
import mlflow as mlf
import pandas as pd
model = mlf.keras.load_model("movies_imdb")
with open('movies_imdb/input_example.json', 'r') as datafile:
data = json.load(datafile)['inputs']
input_dictionary = {idx:x for idx, x in enumerate(data)}
input_ex = pd.DataFrame([input_dictionary])
print(model.predict(input_ex))