I’m continuing to explore interesting ways to display NLP model probabilities. Over the past couple of weeks, I’ve run into challenges converting models saved in .keras or .h5 formats into TensorFlow-compatible JSON files for browser-based interaction.Flask has been helpful. It lets me connect my frontend JavaScript app to a locally hosted Python backend. This setup allows me to use the model without needing to convert it to a JSON and also avoids the risk of corrupting its weights.
Some important terms I learnt while doing this, and then the code:
The most common and fundamental communication protocol between clients and servers on the internet. Clients can use HTTP to request data from the server.
HTTP requests consists of
The address where a web service or API can be accessed from (can’t stop thinking about the hallway scenes in the matrix). Once the client goes to an endpoint he makes an HTTP request.
One of the methods used in HTTP requests. This method is used to request data from the server without causing any side effects in the server. So basically requesting data that was already available without manipulating it.
Another common method used in HTTP. This one sends data to the server that CAN create new data. Example:
Client: Here is data!
Server: Thanks! I did some stuff to it, take a look.
Client: Wow, love what you’ve done to my data.