%% Generated by Sphinx.
\def\sphinxdocclass{report}
\documentclass[letterpaper,10pt,english]{sphinxmanual}
\ifdefined\pdfpxdimen
   \let\sphinxpxdimen\pdfpxdimen\else\newdimen\sphinxpxdimen
\fi \sphinxpxdimen=.75bp\relax

\PassOptionsToPackage{warn}{textcomp}
\usepackage[utf8]{inputenc}
\ifdefined\DeclareUnicodeCharacter
% support both utf8 and utf8x syntaxes
  \ifdefined\DeclareUnicodeCharacterAsOptional
    \def\sphinxDUC#1{\DeclareUnicodeCharacter{"#1}}
  \else
    \let\sphinxDUC\DeclareUnicodeCharacter
  \fi
  \sphinxDUC{00A0}{\nobreakspace}
  \sphinxDUC{2500}{\sphinxunichar{2500}}
  \sphinxDUC{2502}{\sphinxunichar{2502}}
  \sphinxDUC{2514}{\sphinxunichar{2514}}
  \sphinxDUC{251C}{\sphinxunichar{251C}}
  \sphinxDUC{2572}{\textbackslash}
\fi
\usepackage{cmap}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb,amstext}
\usepackage{babel}



\usepackage{times}
\expandafter\ifx\csname T@LGR\endcsname\relax
\else
% LGR was declared as font encoding
  \substitutefont{LGR}{\rmdefault}{cmr}
  \substitutefont{LGR}{\sfdefault}{cmss}
  \substitutefont{LGR}{\ttdefault}{cmtt}
\fi
\expandafter\ifx\csname T@X2\endcsname\relax
  \expandafter\ifx\csname T@T2A\endcsname\relax
  \else
  % T2A was declared as font encoding
    \substitutefont{T2A}{\rmdefault}{cmr}
    \substitutefont{T2A}{\sfdefault}{cmss}
    \substitutefont{T2A}{\ttdefault}{cmtt}
  \fi
\else
% X2 was declared as font encoding
  \substitutefont{X2}{\rmdefault}{cmr}
  \substitutefont{X2}{\sfdefault}{cmss}
  \substitutefont{X2}{\ttdefault}{cmtt}
\fi


\usepackage[Bjarne]{fncychap}
\usepackage{sphinx}

\fvset{fontsize=\small}
\usepackage{geometry}

% Include hyperref last.
\usepackage{hyperref}
% Fix anchor placement for figures with captions.
\usepackage{hypcap}% it must be loaded after hyperref.
% Set up styles of URL: it should be placed after hyperref.
\urlstyle{same}
\addto\captionsenglish{\renewcommand{\contentsname}{Back end:}}

\usepackage{sphinxmessages}
\setcounter{tocdepth}{2}



\title{Automated Essay Grader}
\date{Nov 27, 2019}
\release{}
\author{Kartavya, Aditya, Shreyansh}
\newcommand{\sphinxlogo}{\vbox{}}
\renewcommand{\releasename}{}
\makeindex
\begin{document}

\pagestyle{empty}
\sphinxmaketitle
\pagestyle{plain}
\sphinxtableofcontents
\pagestyle{normal}
\phantomsection\label{\detokenize{index::doc}}


Automated Essay Grader is essentially a usable wrapper for using machine learning models based on Essay grading. Our project runs on \sphinxcode{\sphinxupquote{Starlette server}} hosted on \sphinxcode{\sphinxupquote{Heroku cloud}} with a noSQL database hosted on \sphinxcode{\sphinxupquote{Firebase}}. Using \sphinxcode{\sphinxupquote{MVC architecture}} we have created a web interface powered by \sphinxcode{\sphinxupquote{Bootstrap 4.0}}. Our project also has a fully featured \sphinxcode{\sphinxupquote{Android}} interface.

To check a live web demo \sphinxhref{https://codigos.herokuapp.com/}{Check out}


\chapter{Project environment setup}
\label{\detokenize{index:project-environment-setup}}
To start the project you first need to install all dependencies:

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{pip} \PYG{n}{install} \PYG{n}{requirements}\PYG{o}{.}\PYG{n}{txt}
\end{sphinxVerbatim}

After we have all the requirements set up, we will now create an environment

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{conda} \PYG{n}{env} \PYG{n}{create} \PYG{o}{\PYGZhy{}}\PYG{n}{f} \PYG{n}{Softlab}\PYG{o}{.}\PYG{n}{yml}
\end{sphinxVerbatim}

After the environment is set up you can initialize the environment somehow

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{conda} \PYG{n}{activate} \PYG{n}{Softlab}
\end{sphinxVerbatim}

Yes that was it!! Now simply start the system by typing

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{python3} \PYG{n}{main}\PYG{o}{.}\PYG{n}{py}
\end{sphinxVerbatim}


\chapter{Deployment steps using Docker}
\label{\detokenize{index:deployment-steps-using-docker}}\begin{enumerate}
\sphinxsetlistlabels{\arabic}{enumi}{enumii}{}{)}%
\item {} 
You can simply build the the image file by running following in the directory where Dockerfile is present

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{docker} \PYG{n}{build} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{tag} \PYG{n}{essay}\PYG{o}{\PYGZhy{}}\PYG{n}{grader} \PYG{o}{.}
\end{sphinxVerbatim}

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{docker} \PYG{n}{run} \PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy{}}\PYG{n}{name} \PYG{n}{essay}\PYG{o}{\PYGZhy{}}\PYG{n}{grader} \PYG{o}{\PYGZhy{}}\PYG{n}{p} \PYG{l+m+mi}{8000}\PYG{p}{:}\PYG{l+m+mi}{8000} \PYG{n}{essay}\PYG{o}{\PYGZhy{}}\PYG{n}{grader}
\end{sphinxVerbatim}

\end{enumerate}


\chapter{Checkout some code now}
\label{\detokenize{index:checkout-some-code-now}}

\section{MVC architecture connections}
\label{\detokenize{main:mvc-architecture-connections}}\label{\detokenize{main::doc}}
This is a short description of the code belonging to the plumbing between frontend and backend

The code in this file is mainly plumbing between the frontend and ML backend. It consists of routes which map to the browser url. We use the MVC architechture where we code the controller and modals. View manager in our code is Jinga2vec

\phantomsection\label{\detokenize{main:module-main}}\index{main (module)@\spxentry{main}\spxextra{module}}\index{contrbPage() (in module main)@\spxentry{contrbPage()}\spxextra{in module main}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{main:main.contrbPage}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{async }}\sphinxcode{\sphinxupquote{main.}}\sphinxbfcode{\sphinxupquote{contrbPage}}}{\emph{request}}{}
This function gives people the option to contribute the essay set and make the model better.

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{Essay}\PYG{p}{:} \PYG{n}{Hi}\PYG{p}{,} \PYG{n}{this} \PYG{o+ow}{is} \PYG{n}{the} \PYG{n}{festival} \PYG{n}{of} \PYG{n}{diwali} \PYG{o+ow}{and} \PYG{n}{I} \PYG{n}{like} \PYG{n}{to} \PYG{n}{enjoy} \PYG{n}{it} \PYG{k}{with} \PYG{n}{my} \PYG{n}{friends} \PYG{o+ow}{and} \PYG{n}{pet} \PYG{n}{cow}
\end{sphinxVerbatim}

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{Score}\PYG{p}{:} \PYG{l+m+mi}{30}\PYG{o}{/}\PYG{l+m+mi}{100}
\end{sphinxVerbatim}

\end{fulllineitems}

\index{evaluate() (in module main)@\spxentry{evaluate()}\spxextra{in module main}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{main:main.evaluate}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{async }}\sphinxcode{\sphinxupquote{main.}}\sphinxbfcode{\sphinxupquote{evaluate}}}{\emph{request}}{}
The function evaluate: stores the user input essay and corresponding score
We have two calls of function evaluate with the distinction of the routes with totally different route.
\begin{enumerate}
\sphinxsetlistlabels{\arabic}{enumi}{enumii}{}{)}%
\item {} \begin{description}
\item[{\sphinxcode{\sphinxupquote{@app.route('/evaluate',methods={[}"POST"{]})}}}] \leavevmode
This sends the essay to the server and recieves the score after some calculation.

\end{description}

\item {} \begin{description}
\item[{\sphinxcode{\sphinxupquote{@app.route('/contribute',methods={[}"POST"{]})}}}] \leavevmode
This is to store the essay and score pair provided by the user and appreciate the wholsomeness of it

\end{description}

\end{enumerate}

\end{fulllineitems}

\index{evaluateFile() (in module main)@\spxentry{evaluateFile()}\spxextra{in module main}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{main:main.evaluateFile}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{async }}\sphinxcode{\sphinxupquote{main.}}\sphinxbfcode{\sphinxupquote{evaluateFile}}}{\emph{request}}{}
This funicton gives us a method to get the text out of file directly. Intead of writing text, it is better to upload text.

We see the function on a route \sphinxcode{\sphinxupquote{@app.route('/evaluateFile',methods={[}"POST"{]})}}

\end{fulllineitems}

\index{firebase\_login() (in module main)@\spxentry{firebase\_login()}\spxextra{in module main}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{main:main.firebase_login}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{async }}\sphinxcode{\sphinxupquote{main.}}\sphinxbfcode{\sphinxupquote{firebase\_login}}}{\emph{request}}{}
This function deals with authentication in the code
\begin{quote}\begin{description}
\item[{Param}] \leavevmode
request

\item[{Return type}] \leavevmode

Templating engine for Python3 rendering

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{cool}\PYG{n+nd}{@cool}\PYG{o}{.}\PYG{n}{com} \PYG{o+ow}{and} \PYG{n}{coolcool}
\end{sphinxVerbatim}


\end{description}\end{quote}

\end{fulllineitems}

\index{firebase\_register() (in module main)@\spxentry{firebase\_register()}\spxextra{in module main}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{main:main.firebase_register}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{async }}\sphinxcode{\sphinxupquote{main.}}\sphinxbfcode{\sphinxupquote{firebase\_register}}}{\emph{request}}{}
This function registers us on the firebase platform.

It accepts user input from UI, ie. The email and password

The route for the same would be \sphinxcode{\sphinxupquote{@app.route('/registration',methods={[}"POST"{]})}}

\end{fulllineitems}

\index{getEssay() (in module main)@\spxentry{getEssay()}\spxextra{in module main}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{main:main.getEssay}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{async }}\sphinxcode{\sphinxupquote{main.}}\sphinxbfcode{\sphinxupquote{getEssay}}}{\emph{request}}{}
This function getEssay is here to give us access to the cloud hosted url whenever. We can now check about donated essays till now.
This controller operates on route \sphinxcode{\sphinxupquote{@app.route('/\{prompt\}')}}

\end{fulllineitems}

\index{login() (in module main)@\spxentry{login()}\spxextra{in module main}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{main:main.login}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{async }}\sphinxcode{\sphinxupquote{main.}}\sphinxbfcode{\sphinxupquote{login}}}{\emph{request}}{}
For the controller Login, we have two different routes
\begin{enumerate}
\sphinxsetlistlabels{\arabic}{enumi}{enumii}{}{)}%
\item {} 
\sphinxcode{\sphinxupquote{@app.route('/')}}, This is invoked when we have a redirect to and from the default start state or direct home href links

\end{enumerate}

2) \sphinxcode{\sphinxupquote{@app.route('/register')}} We get here when it’s the login link vi
This function gives us the ability of logging in if our username and pass match

\end{fulllineitems}

\index{show\_index() (in module main)@\spxentry{show\_index()}\spxextra{in module main}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{main:main.show_index}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{async }}\sphinxcode{\sphinxupquote{main.}}\sphinxbfcode{\sphinxupquote{show\_index}}}{\emph{request}}{}
The function is a controller. It is invoked when we call \sphinxcode{\sphinxupquote{/auth}}

\end{fulllineitems}



\section{Automated essay grader model}
\label{\detokenize{prediction:automated-essay-grader-model}}\label{\detokenize{prediction::doc}}
Here we have a very short description of the module prediction part of the parent project Automated essay grader model.

This is an efcient wrapper around a automated essay grading system

\phantomsection\label{\detokenize{prediction:module-prediction}}\index{prediction (module)@\spxentry{prediction}\spxextra{module}}\index{getAvgFeatureVecs() (in module prediction)@\spxentry{getAvgFeatureVecs()}\spxextra{in module prediction}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{prediction:prediction.getAvgFeatureVecs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{prediction.}}\sphinxbfcode{\sphinxupquote{getAvgFeatureVecs}}}{\emph{essays}, \emph{model}, \emph{num\_features}}{}
Main function to generate the word vectors for word2vec model.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstyleliteralstrong{\sphinxupquote{essays}} \textendash{} Input is essays

\item {} 
\sphinxstyleliteralstrong{\sphinxupquote{model}} \textendash{} This input specifies the model to be used to generate Feature vec

\item {} 
\sphinxstyleliteralstrong{\sphinxupquote{num\_features}} \textendash{} This is a metric of number of columns in the matrix cols

\end{itemize}

\item[{Return type}] \leavevmode
Returns the essay feature vector

\end{description}\end{quote}

\end{fulllineitems}

\index{makeFeatureVec() (in module prediction)@\spxentry{makeFeatureVec()}\spxextra{in module prediction}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{prediction:prediction.makeFeatureVec}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{prediction.}}\sphinxbfcode{\sphinxupquote{makeFeatureVec}}}{\emph{words}, \emph{model}, \emph{num\_features}}{}
This function generates feature vectors for each dimension ie. plane
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {} 
\sphinxstyleliteralstrong{\sphinxupquote{words}} \textendash{} We pass the words that we needed

\item {} 
\sphinxstyleliteralstrong{\sphinxupquote{model}} \textendash{} Model to decide on what basis police have been arrested

\end{itemize}

\item[{Return type}] \leavevmode
\sphinxcode{\sphinxupquote{featureVec}} is the result of the function

\end{description}\end{quote}

\end{fulllineitems}

\index{predict() (in module prediction)@\spxentry{predict()}\spxextra{in module prediction}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{prediction:prediction.predict}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{prediction.}}\sphinxbfcode{\sphinxupquote{predict}}}{\emph{essay}}{}
This is the function which calculates the score given an essay
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\sphinxstyleliteralstrong{\sphinxupquote{essay}} \textendash{} This input is the essay that we got from the fronend.

\item[{Return type}] \leavevmode
We are returning the y\_pred values

\end{description}\end{quote}

\end{fulllineitems}

\index{tokenizeEssay() (in module prediction)@\spxentry{tokenizeEssay()}\spxextra{in module prediction}}

\begin{fulllineitems}
\phantomsection\label{\detokenize{prediction:prediction.tokenizeEssay}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{prediction.}}\sphinxbfcode{\sphinxupquote{tokenizeEssay}}}{\emph{essay}}{}
This funciton tokenizes the text provided as input in the from of essay

We remove \sphinxcode{\sphinxupquote{stopwords}} from the essay

\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{This} \PYG{o+ow}{is} \PYG{n}{america}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{america}
\end{sphinxVerbatim}
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode
\sphinxstyleliteralstrong{\sphinxupquote{essay}} \textendash{} Input in the form of text

\item[{Return type}] \leavevmode
Tokenized words

\end{description}\end{quote}

\end{fulllineitems}



\section{Web views}
\label{\detokenize{web:web-views}}\label{\detokenize{web::doc}}
This is the documentation for the web front end portal

\sphinxcode{\sphinxupquote{Login.html}}

\begin{figure}[htbp]
\centering

\noindent\sphinxincludegraphics{{5}.jpeg}
\end{figure}

\sphinxcode{\sphinxupquote{Register.html}}

\begin{figure}[htbp]
\centering

\noindent\sphinxincludegraphics{{6}.jpeg}
\end{figure}

\sphinxcode{\sphinxupquote{Index.html}}

\begin{figure}[htbp]
\centering

\noindent\sphinxincludegraphics{{2}.jpeg}
\end{figure}

\sphinxcode{\sphinxupquote{Score.html}}

\begin{figure}[htbp]
\centering

\noindent\sphinxincludegraphics{{1}.jpeg}
\end{figure}

\sphinxcode{\sphinxupquote{Contribute.html}}

\begin{figure}[htbp]
\centering

\noindent\sphinxincludegraphics{{3}.jpeg}
\end{figure}

\sphinxcode{\sphinxupquote{Thanks.html}}

\begin{figure}[htbp]
\centering

\noindent\sphinxincludegraphics{{4}.jpeg}
\end{figure}


\section{Android application}
\label{\detokenize{android:android-application}}\label{\detokenize{android::doc}}
This is the documentation for android application

\sphinxcode{\sphinxupquote{Login}}

\begin{figure}[htbp]
\centering

\noindent\sphinxincludegraphics[width=300\sphinxpxdimen,height=600\sphinxpxdimen]{{9}.jpeg}
\end{figure}

\sphinxcode{\sphinxupquote{Register}}

\begin{figure}[htbp]
\centering

\noindent\sphinxincludegraphics[width=300\sphinxpxdimen,height=600\sphinxpxdimen]{{11}.jpeg}
\end{figure}

\sphinxcode{\sphinxupquote{Evaluate}}

\begin{figure}[htbp]
\centering

\noindent\sphinxincludegraphics[width=300\sphinxpxdimen,height=600\sphinxpxdimen]{{12}.jpeg}
\end{figure}

\sphinxcode{\sphinxupquote{Score}}

\begin{figure}[htbp]
\centering

\noindent\sphinxincludegraphics[width=300\sphinxpxdimen,height=600\sphinxpxdimen]{{13}.jpeg}
\end{figure}

\sphinxcode{\sphinxupquote{Contribute}}

\begin{figure}[htbp]
\centering

\noindent\sphinxincludegraphics[width=300\sphinxpxdimen,height=600\sphinxpxdimen]{{10}.jpeg}
\end{figure}


\chapter{Indices and tables}
\label{\detokenize{index:indices-and-tables}}\begin{itemize}
\item {} 
\DUrole{xref,std,std-ref}{genindex}

\item {} 
\DUrole{xref,std,std-ref}{modindex}

\item {} 
\DUrole{xref,std,std-ref}{search}

\end{itemize}


\renewcommand{\indexname}{Python Module Index}
\begin{sphinxtheindex}
\let\bigletter\sphinxstyleindexlettergroup
\bigletter{m}
\item\relax\sphinxstyleindexentry{main}\sphinxstyleindexpageref{main:\detokenize{module-main}}
\indexspace
\bigletter{p}
\item\relax\sphinxstyleindexentry{prediction}\sphinxstyleindexpageref{prediction:\detokenize{module-prediction}}
\end{sphinxtheindex}

\renewcommand{\indexname}{Index}
\printindex
\end{document}