I have been trying to make a basic flask app. I returned the string processed text in the jasonify format in the app.py file. But I don't know how to receive the particular string value into a java-script variable in the index.html file.
Can anyone help me out with this?
The following code is a part of the file app.py:
@app.route('/', methods = ['POST'])
def my_form_post():
MAX_SEQUENCE_LENGTH = 30
best_model = load_model('BalanceNet.h5')
#data2 = pd.read_csv('train.csv')
text = request.form['u']
x = text.split(' ')
y = [int(k) for k in x]
data_int_t = pad_sequences([y, [], [], [], []], padding='pre', maxlen=(MAX_SEQUENCE_LENGTH-5))
data_test = pad_sequences(data_int_t, padding='post', maxlen=(MAX_SEQUENCE_LENGTH))
y_prob = best_model.predict(data_test)
processed_text = str(y_prob[0][0])
return jsonify({'request' : processed_text})

