If you don't need to have it update very quickly, you can write to a file in gdscript (eg. input.csv), send it to python, use that data as inputs (using keras/tensorflow or something), then write the outputs to a file in python, and read them in gdscript. You do always need the python script to be running in the background, however.