Hello @Pradyumn Joshi,
welcome to this moderated Azure community forum.
The first possible issue is that no decent JSON is outputted by:
json.dumps({"prediction": prediction.tolist()})
It's not clear to me how 'prediction' looks like or what 'prediction.tolist()' produces.
Perhaps the problem is just lack of quotation:
{"data": I like this}
This is not correct JSON.
Please add some debug lines and check the output of the 'json.dumps()'
Then I noticed you say '{"data":"I like this"}' but the code outputs '{"prediction": prediction.tolist()}'.
Finally, Stream Analytics is complaining about yet another format containing 'inputName' or 'Inputs'.
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.