File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
"""
3
- This is the Flask REST API that processed and outputs the prediction on the URL.
3
+ This is the Flask REST API that processes and outputs the prediction on the URL.
4
4
"""
5
5
import numpy as np
6
6
from keras .models import load_model
11
11
import flask
12
12
import json
13
13
14
- # Initialize our Flask application and the Keras model
14
+ # Initialize our Flask application and the Keras model.
15
15
app = flask .Flask (__name__ )
16
16
17
-
18
17
global graph
19
18
graph = tf .get_default_graph ()
20
19
model_pre = 'bi-lstmchar256256128.h5'
@@ -53,6 +52,7 @@ def predict():
53
52
54
53
# Check if POST request.
55
54
if flask .request .method == "POST" :
55
+
56
56
# Grab and process the incoming json.
57
57
incoming = flask .request .get_json ()
58
58
urlz = []
@@ -83,7 +83,7 @@ def predict():
83
83
if "/" not in split2 :
84
84
result = "Base URLs cannot be accurately determined."
85
85
86
- # Process prediction probability into something human-friendly .
86
+ # Processes prediction probability.
87
87
prediction = float (prediction )
88
88
prediction = prediction * 100
89
89
You can’t perform that action at this time.
0 commit comments