Communication between Java and Python Script

I'm creating a chatbot using Thymeleaf and Logback-classic for Java ( web part, localhost ) and Tensorflow for my python script ( which is on the desk).

My python script works as this: enter image description here

i.e: The user asks a question , the bot answers it.

I want to know how from the form the user send in the java platform will get to the script, so the script will process it, then how to send the answer back to the java, like http requests?

Thank you