From Previous page, when i continued with importing the package Intent and file PredictIntent, i tried to use it as follows,
>>> from Intent import PredictIntent
>>> PredictIntent.predict("How are you?")
Evaluating...
INFO:tensorflow:Restoring parameters from /home/cdpdemo/tensorflow/Intent/runs/1495193437/checkpoints/model-101600
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/cdpdemo/tensorflow/Intent/PredictIntent.py", line 77, in predict
predictions_human_readable = np.column_stack((np.array(x_raw), all_predictions))
File "/usr/lib/python2.7/dist-packages/numpy/lib/shape_base.py", line 317, in column_stack
return _nx.concatenate(arrays, 1)
ValueError: all the input array dimensions except for the concatenation axis must match exactly
But received error.
This error was because predict takes arrays of strings to predict classes.
>>> PredictIntent.predict(["I have issue with RPM?"])
Evaluating...
INFO:tensorflow:Restoring parameters from /home/cdpdemo/tensorflow/Intent/runs/1495193437/checkpoints/model-101600
[ 58.]
['I have issue with RPM?']
[['I have issue with RPM?' '58.0']]
('Description:', 'I have issue with RPM?', ', Category:', 'cat-2')
'cat-2'