from nazoru import get_default_graph_path
from nazoru.core import NazoruPredictor
predictor = NazoruPredictor(get_default_graph_path())
# [(key, ms_from_first_input)]
sample_input = [('e', 0), ('d', 100), ('c', 200), ('v', 300),
('u', 800), ('j', 900)]
results = predictor.predict_top_n(sample_input, 5)
for result in results:
print('kana: %s, key: %s, probability: %.3f' % result)
|