April 2020
Intermediate to advanced
380 pages
9h 24m
English
In this section, we will create an API that is used to authenticate users when they submit their login request to the model. The request headers will be parsed as a string and the model will use it to predict whether the login is valid:
from sklearn.externals import joblibfrom flask import Flask, request, jsonifyfrom string import digitsimport sysimport osimport jsonimport pandasimport numpyimport optparsefrom keras.models import Sequential, load_modelfrom keras.preprocessing import sequencefrom keras.preprocessing.text import Tokenizerfrom collections import OrderedDict
Read now
Unlock full access