├── .DS_Store ├── .ipynb_checkpoints └── Training LSTM Model-checkpoint.ipynb ├── README.md ├── ScreenShots ├── .DS_Store ├── SC1.png ├── SC2.png └── SC3.png ├── Training LSTM Model.ipynb ├── data ├── .DS_Store ├── Essay_Set_Descriptions.zip ├── Essay_Set_Descriptions │ ├── Essay Set #1--ReadMeFirst.docx │ ├── Essay Set #2--ReadMeFirst.docx │ ├── Essay Set #3--ReadMeFirst.docx │ ├── Essay Set #4--ReadMeFirst.docx │ ├── Essay Set #5--ReadMeFirst.docx │ ├── Essay Set #6--ReadMeFirst.docx │ ├── Essay Set #7--ReadMeFirst.docx │ ├── Essay Set #8--ReadMeFirst.docx │ ├── Guidelines for Transcribing Student Essays.docx │ └── essay_set_descriptions.xlsx ├── Training_Materials.zip ├── test_set.tsv ├── training_set_rel3.tsv ├── training_set_rel3.xls ├── training_set_rel3.xlsx ├── valid_sample_submission_1_column.csv ├── valid_sample_submission_1_column_no_header.csv ├── valid_sample_submission_2_column.csv ├── valid_sample_submission_5_column.csv ├── valid_set.tsv ├── valid_set.xls └── valid_set.xlsx ├── model_weights ├── .DS_Store └── final_lstm.h5 ├── models ├── __pycache__ │ ├── __init__.cpython-36.pyc │ ├── blstm.cpython-36.pyc │ ├── cnn_lstm.cpython-36.pyc │ ├── cnn_lstm_mot.cpython-36.pyc │ ├── feed_forward.cpython-36.pyc │ ├── lstm.cpython-36.pyc │ └── lstm_mot.cpython-36.pyc ├── blstm.py ├── cnn_lstm.py ├── cnn_lstm_mot.py ├── feed_forward.py ├── lstm.py └── lstm_mot.py ├── mysite ├── .DS_Store ├── db.sqlite3 ├── grader │ ├── .DS_Store │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── __init__.cpython-37.pyc │ │ ├── admin.cpython-36.pyc │ │ ├── admin.cpython-37.pyc │ │ ├── apps.cpython-36.pyc │ │ ├── apps.cpython-37.pyc │ │ ├── forms.cpython-36.pyc │ │ ├── forms.cpython-37.pyc │ │ ├── models.cpython-36.pyc │ │ ├── models.cpython-37.pyc │ │ ├── urls.cpython-36.pyc │ │ ├── urls.cpython-37.pyc │ │ ├── views.cpython-36.pyc │ │ └── views.cpython-37.pyc │ ├── admin.py │ ├── apps.py │ ├── deep_learning_files │ │ ├── final_lstm.h5 │ │ └── word2vec.bin │ ├── forms.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_question_essayset.py │ │ ├── 0003_auto_20180812_1543.py │ │ ├── 0004_auto_20180812_1546.py │ │ ├── 0005_auto_20180812_1549.py │ │ ├── 0006_essay_score.py │ │ ├── 0007_auto_20180812_1555.py │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ ├── 0001_initial.cpython-36.pyc │ │ │ ├── 0001_initial.cpython-37.pyc │ │ │ ├── 0002_question_essayset.cpython-36.pyc │ │ │ ├── 0002_question_essayset.cpython-37.pyc │ │ │ ├── 0003_auto_20180812_1543.cpython-36.pyc │ │ │ ├── 0003_auto_20180812_1543.cpython-37.pyc │ │ │ ├── 0004_auto_20180812_1546.cpython-36.pyc │ │ │ ├── 0004_auto_20180812_1546.cpython-37.pyc │ │ │ ├── 0005_auto_20180812_1549.cpython-36.pyc │ │ │ ├── 0005_auto_20180812_1549.cpython-37.pyc │ │ │ ├── 0006_essay_score.cpython-36.pyc │ │ │ ├── 0006_essay_score.cpython-37.pyc │ │ │ ├── 0007_auto_20180812_1555.cpython-36.pyc │ │ │ ├── 0007_auto_20180812_1555.cpython-37.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── __init__.cpython-37.pyc │ ├── models.py │ ├── static │ │ ├── .DS_Store │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ ├── templates │ │ ├── .DS_Store │ │ ├── grader │ │ │ ├── essay.html │ │ │ ├── index.html │ │ │ └── question.html │ │ └── includes │ │ │ └── form.html │ ├── tests.py │ ├── urls.py │ ├── utils │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── helpers.cpython-36.pyc │ │ │ ├── helpers.cpython-37.pyc │ │ │ ├── model.cpython-36.pyc │ │ │ └── model.cpython-37.pyc │ │ ├── helpers.py │ │ └── model.py │ └── views.py ├── manage.py ├── mysite │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── __init__.cpython-37.pyc │ │ ├── settings.cpython-36.pyc │ │ ├── settings.cpython-37.pyc │ │ ├── urls.cpython-36.pyc │ │ ├── urls.cpython-37.pyc │ │ ├── wsgi.cpython-36.pyc │ │ └── wsgi.cpython-37.pyc │ ├── settings.py │ ├── urls.py │ └── wsgi.py └── templates │ └── base.html └── word2vecmodel.bin /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/.DS_Store -------------------------------------------------------------------------------- /.ipynb_checkpoints/Training LSTM Model-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## Importing the Data" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": 1, 13 | "metadata": {}, 14 | "outputs": [], 15 | "source": [ 16 | "# Constants\n", 17 | "DATASET_DIR = './data/'\n", 18 | "GLOVE_DIR = './glove.6B/'\n", 19 | "SAVE_DIR = './'\n", 20 | "\n", 21 | "import os\n", 22 | "import pandas as pd\n", 23 | "\n", 24 | "X = pd.read_csv(os.path.join(DATASET_DIR, 'training_set_rel3.tsv'), sep='\\t', encoding='ISO-8859-1')\n", 25 | "y = X['domain1_score']\n", 26 | "X = X.dropna(axis=1)\n", 27 | "X = X.drop(columns=['rater1_domain1', 'rater2_domain1'])" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": 2, 33 | "metadata": {}, 34 | "outputs": [ 35 | { 36 | "data": { 37 | "text/html": [ 38 | "
\n", 39 | "\n", 52 | "\n", 53 | " \n", 54 | " \n", 55 | " \n", 56 | " \n", 57 | " \n", 58 | " \n", 59 | " \n", 60 | " \n", 61 | " \n", 62 | " \n", 63 | " \n", 64 | " \n", 65 | " \n", 66 | " \n", 67 | " \n", 68 | " \n", 69 | " \n", 70 | " \n", 71 | " \n", 72 | " \n", 73 | " \n", 74 | " \n", 75 | " \n", 76 | " \n", 77 | " \n", 78 | " \n", 79 | " \n", 80 | " \n", 81 | " \n", 82 | " \n", 83 | " \n", 84 | " \n", 85 | " \n", 86 | " \n", 87 | " \n", 88 | " \n", 89 | " \n", 90 | " \n", 91 | " \n", 92 | " \n", 93 | " \n", 94 | " \n", 95 | " \n", 96 | " \n", 97 | " \n", 98 | " \n", 99 | "
essay_idessay_setessaydomain1_score
011Dear local newspaper, I think effects computer...8
121Dear @CAPS1 @CAPS2, I believe that using compu...9
231Dear, @CAPS1 @CAPS2 @CAPS3 More and more peopl...7
341Dear Local Newspaper, @CAPS1 I have found that...10
451Dear @LOCATION1, I know having computers has a...8
\n", 100 | "
" 101 | ], 102 | "text/plain": [ 103 | " essay_id essay_set essay \\\n", 104 | "0 1 1 Dear local newspaper, I think effects computer... \n", 105 | "1 2 1 Dear @CAPS1 @CAPS2, I believe that using compu... \n", 106 | "2 3 1 Dear, @CAPS1 @CAPS2 @CAPS3 More and more peopl... \n", 107 | "3 4 1 Dear Local Newspaper, @CAPS1 I have found that... \n", 108 | "4 5 1 Dear @LOCATION1, I know having computers has a... \n", 109 | "\n", 110 | " domain1_score \n", 111 | "0 8 \n", 112 | "1 9 \n", 113 | "2 7 \n", 114 | "3 10 \n", 115 | "4 8 " 116 | ] 117 | }, 118 | "execution_count": 2, 119 | "metadata": {}, 120 | "output_type": "execute_result" 121 | } 122 | ], 123 | "source": [ 124 | "X.head()" 125 | ] 126 | }, 127 | { 128 | "cell_type": "markdown", 129 | "metadata": {}, 130 | "source": [ 131 | "Minimum and Maximum Scores for each essay set." 132 | ] 133 | }, 134 | { 135 | "cell_type": "code", 136 | "execution_count": 3, 137 | "metadata": {}, 138 | "outputs": [], 139 | "source": [ 140 | "minimum_scores = [-1, 2, 1, 0, 0, 0, 0, 0, 0]\n", 141 | "maximum_scores = [-1, 12, 6, 3, 3, 4, 4, 30, 60]" 142 | ] 143 | }, 144 | { 145 | "cell_type": "markdown", 146 | "metadata": {}, 147 | "source": [ 148 | "## Preprocessing the Data" 149 | ] 150 | }, 151 | { 152 | "cell_type": "markdown", 153 | "metadata": {}, 154 | "source": [ 155 | "We will preprocess all essays and convert them to feature vectors so that they can be fed into the RNN.\n", 156 | "\n", 157 | "These are all helper functions used to clean the essays." 158 | ] 159 | }, 160 | { 161 | "cell_type": "code", 162 | "execution_count": 4, 163 | "metadata": {}, 164 | "outputs": [], 165 | "source": [ 166 | "import numpy as np\n", 167 | "import nltk\n", 168 | "import re\n", 169 | "from nltk.corpus import stopwords\n", 170 | "from gensim.models import Word2Vec\n", 171 | "\n", 172 | "def essay_to_wordlist(essay_v, remove_stopwords):\n", 173 | " \"\"\"Remove the tagged labels and word tokenize the sentence.\"\"\"\n", 174 | " essay_v = re.sub(\"[^a-zA-Z]\", \" \", essay_v)\n", 175 | " words = essay_v.lower().split()\n", 176 | " if remove_stopwords:\n", 177 | " stops = set(stopwords.words(\"english\"))\n", 178 | " words = [w for w in words if not w in stops]\n", 179 | " return (words)\n", 180 | "\n", 181 | "def essay_to_sentences(essay_v, remove_stopwords):\n", 182 | " \"\"\"Sentence tokenize the essay and call essay_to_wordlist() for word tokenization.\"\"\"\n", 183 | " tokenizer = nltk.data.load('tokenizers/punkt/english.pickle')\n", 184 | " raw_sentences = tokenizer.tokenize(essay_v.strip())\n", 185 | " sentences = []\n", 186 | " for raw_sentence in raw_sentences:\n", 187 | " if len(raw_sentence) > 0:\n", 188 | " sentences.append(essay_to_wordlist(raw_sentence, remove_stopwords))\n", 189 | " return sentences\n", 190 | "\n", 191 | "def makeFeatureVec(words, model, num_features):\n", 192 | " \"\"\"Make Feature Vector from the words list of an Essay.\"\"\"\n", 193 | " featureVec = np.zeros((num_features,),dtype=\"float32\")\n", 194 | " num_words = 0.\n", 195 | " index2word_set = set(model.wv.index2word)\n", 196 | " for word in words:\n", 197 | " if word in index2word_set:\n", 198 | " num_words += 1\n", 199 | " featureVec = np.add(featureVec,model[word]) \n", 200 | " featureVec = np.divide(featureVec,num_words)\n", 201 | " return featureVec\n", 202 | "\n", 203 | "def getAvgFeatureVecs(essays, model, num_features):\n", 204 | " \"\"\"Main function to generate the word vectors for word2vec model.\"\"\"\n", 205 | " counter = 0\n", 206 | " essayFeatureVecs = np.zeros((len(essays),num_features),dtype=\"float32\")\n", 207 | " for essay in essays:\n", 208 | " essayFeatureVecs[counter] = makeFeatureVec(essay, model, num_features)\n", 209 | " counter = counter + 1\n", 210 | " return essayFeatureVecs" 211 | ] 212 | }, 213 | { 214 | "cell_type": "code", 215 | "execution_count": 5, 216 | "metadata": {}, 217 | "outputs": [ 218 | { 219 | "name": "stderr", 220 | "output_type": "stream", 221 | "text": [ 222 | "[nltk_data] Downloading package stopwords to /home/ronit/nltk_data...\n", 223 | "[nltk_data] Package stopwords is already up-to-date!\n" 224 | ] 225 | }, 226 | { 227 | "data": { 228 | "text/plain": [ 229 | "True" 230 | ] 231 | }, 232 | "execution_count": 5, 233 | "metadata": {}, 234 | "output_type": "execute_result" 235 | } 236 | ], 237 | "source": [ 238 | "import nltk\n", 239 | "\n", 240 | "nltk.download('stopwords')" 241 | ] 242 | }, 243 | { 244 | "cell_type": "markdown", 245 | "metadata": {}, 246 | "source": [ 247 | "## Defining the model " 248 | ] 249 | }, 250 | { 251 | "cell_type": "markdown", 252 | "metadata": {}, 253 | "source": [ 254 | "Here we define a 2-Layer LSTM Model. \n", 255 | "\n", 256 | "Note that instead of using sigmoid activation in the output layer we will use\n", 257 | "Relu since we are not normalising training labels." 258 | ] 259 | }, 260 | { 261 | "cell_type": "code", 262 | "execution_count": 6, 263 | "metadata": {}, 264 | "outputs": [ 265 | { 266 | "name": "stderr", 267 | "output_type": "stream", 268 | "text": [ 269 | "Using TensorFlow backend.\n", 270 | "/home/ronit/.local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 271 | " _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\n", 272 | "/home/ronit/.local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 273 | " _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\n", 274 | "/home/ronit/.local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 275 | " _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\n", 276 | "/home/ronit/.local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 277 | " _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\n", 278 | "/home/ronit/.local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 279 | " _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\n", 280 | "/home/ronit/.local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 281 | " np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\n", 282 | "/home/ronit/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 283 | " _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\n", 284 | "/home/ronit/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 285 | " _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\n", 286 | "/home/ronit/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 287 | " _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\n", 288 | "/home/ronit/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 289 | " _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\n", 290 | "/home/ronit/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 291 | " _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\n", 292 | "/home/ronit/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 293 | " np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\n" 294 | ] 295 | } 296 | ], 297 | "source": [ 298 | "from keras.layers import Embedding, LSTM, Dense, Dropout, Lambda, Flatten\n", 299 | "from keras.models import Sequential, load_model, model_from_config\n", 300 | "import keras.backend as K\n", 301 | "\n", 302 | "def get_model():\n", 303 | " \"\"\"Define the model.\"\"\"\n", 304 | " model = Sequential()\n", 305 | " model.add(LSTM(300, dropout=0.4, recurrent_dropout=0.4, input_shape=[1, 300], return_sequences=True))\n", 306 | " model.add(LSTM(64, recurrent_dropout=0.4))\n", 307 | " model.add(Dropout(0.5))\n", 308 | " model.add(Dense(1, activation='relu'))\n", 309 | "\n", 310 | " model.compile(loss='mean_squared_error', optimizer='rmsprop', metrics=['mae'])\n", 311 | " model.summary()\n", 312 | "\n", 313 | " return model" 314 | ] 315 | }, 316 | { 317 | "cell_type": "markdown", 318 | "metadata": {}, 319 | "source": [ 320 | "## Training Phase" 321 | ] 322 | }, 323 | { 324 | "cell_type": "markdown", 325 | "metadata": {}, 326 | "source": [ 327 | "Now we train the model on the dataset.\n", 328 | "\n", 329 | "We will use 5-Fold Cross Validation and measure the Quadratic Weighted Kappa for each fold.\n", 330 | "We will then calculate Average Kappa for all the folds." 331 | ] 332 | }, 333 | { 334 | "cell_type": "code", 335 | "execution_count": 8, 336 | "metadata": {}, 337 | "outputs": [ 338 | { 339 | "name": "stdout", 340 | "output_type": "stream", 341 | "text": [ 342 | "\n", 343 | "--------Fold 1--------\n", 344 | "\n", 345 | "Training Word2Vec Model...\n" 346 | ] 347 | }, 348 | { 349 | "name": "stderr", 350 | "output_type": "stream", 351 | "text": [ 352 | "/home/ronit/.local/lib/python3.7/site-packages/ipykernel_launcher.py:34: DeprecationWarning: Call to deprecated `__getitem__` (Method will be removed in 4.0.0, use self.wv.__getitem__() instead).\n" 353 | ] 354 | }, 355 | { 356 | "name": "stdout", 357 | "output_type": "stream", 358 | "text": [ 359 | "Model: \"sequential_2\"\n", 360 | "_________________________________________________________________\n", 361 | "Layer (type) Output Shape Param # \n", 362 | "=================================================================\n", 363 | "lstm_3 (LSTM) (None, 1, 300) 721200 \n", 364 | "_________________________________________________________________\n", 365 | "lstm_4 (LSTM) (None, 64) 93440 \n", 366 | "_________________________________________________________________\n", 367 | "dropout_2 (Dropout) (None, 64) 0 \n", 368 | "_________________________________________________________________\n", 369 | "dense_2 (Dense) (None, 1) 65 \n", 370 | "=================================================================\n", 371 | "Total params: 814,705\n", 372 | "Trainable params: 814,705\n", 373 | "Non-trainable params: 0\n", 374 | "_________________________________________________________________\n", 375 | "Epoch 1/2\n", 376 | "10380/10380 [==============================] - 3s 242us/step - loss: 65.0803 - mae: 4.4190\n", 377 | "Epoch 2/2\n", 378 | "10380/10380 [==============================] - 2s 216us/step - loss: 41.0397 - mae: 3.6236\n", 379 | "Kappa Score: 0.7486217099570918\n", 380 | "\n", 381 | "--------Fold 2--------\n", 382 | "\n", 383 | "Training Word2Vec Model...\n" 384 | ] 385 | }, 386 | { 387 | "name": "stderr", 388 | "output_type": "stream", 389 | "text": [ 390 | "/home/ronit/.local/lib/python3.7/site-packages/ipykernel_launcher.py:34: DeprecationWarning: Call to deprecated `__getitem__` (Method will be removed in 4.0.0, use self.wv.__getitem__() instead).\n" 391 | ] 392 | }, 393 | { 394 | "name": "stdout", 395 | "output_type": "stream", 396 | "text": [ 397 | "Model: \"sequential_3\"\n", 398 | "_________________________________________________________________\n", 399 | "Layer (type) Output Shape Param # \n", 400 | "=================================================================\n", 401 | "lstm_5 (LSTM) (None, 1, 300) 721200 \n", 402 | "_________________________________________________________________\n", 403 | "lstm_6 (LSTM) (None, 64) 93440 \n", 404 | "_________________________________________________________________\n", 405 | "dropout_3 (Dropout) (None, 64) 0 \n", 406 | "_________________________________________________________________\n", 407 | "dense_3 (Dense) (None, 1) 65 \n", 408 | "=================================================================\n", 409 | "Total params: 814,705\n", 410 | "Trainable params: 814,705\n", 411 | "Non-trainable params: 0\n", 412 | "_________________________________________________________________\n", 413 | "Epoch 1/2\n", 414 | "10381/10381 [==============================] - 3s 251us/step - loss: 62.8194 - mae: 4.3238\n", 415 | "Epoch 2/2\n", 416 | "10381/10381 [==============================] - 2s 216us/step - loss: 40.3073 - mae: 3.6031\n", 417 | "Kappa Score: 0.7366845373546059\n", 418 | "\n", 419 | "--------Fold 3--------\n", 420 | "\n", 421 | "Training Word2Vec Model...\n" 422 | ] 423 | }, 424 | { 425 | "name": "stderr", 426 | "output_type": "stream", 427 | "text": [ 428 | "/home/ronit/.local/lib/python3.7/site-packages/ipykernel_launcher.py:34: DeprecationWarning: Call to deprecated `__getitem__` (Method will be removed in 4.0.0, use self.wv.__getitem__() instead).\n" 429 | ] 430 | }, 431 | { 432 | "name": "stdout", 433 | "output_type": "stream", 434 | "text": [ 435 | "Model: \"sequential_4\"\n", 436 | "_________________________________________________________________\n", 437 | "Layer (type) Output Shape Param # \n", 438 | "=================================================================\n", 439 | "lstm_7 (LSTM) (None, 1, 300) 721200 \n", 440 | "_________________________________________________________________\n", 441 | "lstm_8 (LSTM) (None, 64) 93440 \n", 442 | "_________________________________________________________________\n", 443 | "dropout_4 (Dropout) (None, 64) 0 \n", 444 | "_________________________________________________________________\n", 445 | "dense_4 (Dense) (None, 1) 65 \n", 446 | "=================================================================\n", 447 | "Total params: 814,705\n", 448 | "Trainable params: 814,705\n", 449 | "Non-trainable params: 0\n", 450 | "_________________________________________________________________\n", 451 | "Epoch 1/2\n", 452 | "10381/10381 [==============================] - 3s 246us/step - loss: 63.6039 - mae: 4.3544\n", 453 | "Epoch 2/2\n", 454 | "10381/10381 [==============================] - 2s 212us/step - loss: 40.6817 - mae: 3.6181\n", 455 | "Kappa Score: 0.750224807720522\n", 456 | "\n", 457 | "--------Fold 4--------\n", 458 | "\n", 459 | "Training Word2Vec Model...\n" 460 | ] 461 | }, 462 | { 463 | "name": "stderr", 464 | "output_type": "stream", 465 | "text": [ 466 | "/home/ronit/.local/lib/python3.7/site-packages/ipykernel_launcher.py:34: DeprecationWarning: Call to deprecated `__getitem__` (Method will be removed in 4.0.0, use self.wv.__getitem__() instead).\n" 467 | ] 468 | }, 469 | { 470 | "name": "stdout", 471 | "output_type": "stream", 472 | "text": [ 473 | "Model: \"sequential_5\"\n", 474 | "_________________________________________________________________\n", 475 | "Layer (type) Output Shape Param # \n", 476 | "=================================================================\n", 477 | "lstm_9 (LSTM) (None, 1, 300) 721200 \n", 478 | "_________________________________________________________________\n", 479 | "lstm_10 (LSTM) (None, 64) 93440 \n", 480 | "_________________________________________________________________\n", 481 | "dropout_5 (Dropout) (None, 64) 0 \n", 482 | "_________________________________________________________________\n", 483 | "dense_5 (Dense) (None, 1) 65 \n", 484 | "=================================================================\n", 485 | "Total params: 814,705\n", 486 | "Trainable params: 814,705\n", 487 | "Non-trainable params: 0\n", 488 | "_________________________________________________________________\n", 489 | "Epoch 1/2\n", 490 | "10381/10381 [==============================] - 2s 232us/step - loss: 64.4470 - mae: 4.3468\n", 491 | "Epoch 2/2\n", 492 | "10381/10381 [==============================] - 3s 244us/step - loss: 39.5856 - mae: 3.5689\n", 493 | "Kappa Score: 0.7365923618977773\n", 494 | "\n", 495 | "--------Fold 5--------\n", 496 | "\n", 497 | "Training Word2Vec Model...\n" 498 | ] 499 | }, 500 | { 501 | "name": "stderr", 502 | "output_type": "stream", 503 | "text": [ 504 | "/home/ronit/.local/lib/python3.7/site-packages/ipykernel_launcher.py:34: DeprecationWarning: Call to deprecated `__getitem__` (Method will be removed in 4.0.0, use self.wv.__getitem__() instead).\n" 505 | ] 506 | }, 507 | { 508 | "name": "stdout", 509 | "output_type": "stream", 510 | "text": [ 511 | "Model: \"sequential_6\"\n", 512 | "_________________________________________________________________\n", 513 | "Layer (type) Output Shape Param # \n", 514 | "=================================================================\n", 515 | "lstm_11 (LSTM) (None, 1, 300) 721200 \n", 516 | "_________________________________________________________________\n", 517 | "lstm_12 (LSTM) (None, 64) 93440 \n", 518 | "_________________________________________________________________\n", 519 | "dropout_6 (Dropout) (None, 64) 0 \n", 520 | "_________________________________________________________________\n", 521 | "dense_6 (Dense) (None, 1) 65 \n", 522 | "=================================================================\n", 523 | "Total params: 814,705\n", 524 | "Trainable params: 814,705\n", 525 | "Non-trainable params: 0\n", 526 | "_________________________________________________________________\n", 527 | "Epoch 1/2\n", 528 | "10381/10381 [==============================] - 3s 252us/step - loss: 63.9294 - mae: 4.3457\n", 529 | "Epoch 2/2\n", 530 | "10381/10381 [==============================] - 2s 184us/step - loss: 39.9797 - mae: 3.6093\n", 531 | "Kappa Score: 0.7484117718081168\n" 532 | ] 533 | } 534 | ], 535 | "source": [ 536 | "from sklearn.model_selection import KFold\n", 537 | "from sklearn.linear_model import LinearRegression\n", 538 | "from sklearn.metrics import cohen_kappa_score\n", 539 | "\n", 540 | "cv = KFold(n_splits = 5, shuffle = True)\n", 541 | "results = []\n", 542 | "y_pred_list = []\n", 543 | "\n", 544 | "count = 1\n", 545 | "for traincv, testcv in cv.split(X):\n", 546 | " print(\"\\n--------Fold {}--------\\n\".format(count))\n", 547 | " X_test, X_train, y_test, y_train = X.iloc[testcv], X.iloc[traincv], y.iloc[testcv], y.iloc[traincv]\n", 548 | " \n", 549 | " train_essays = X_train['essay']\n", 550 | " test_essays = X_test['essay']\n", 551 | " \n", 552 | " sentences = []\n", 553 | " \n", 554 | " for essay in train_essays:\n", 555 | " # Obtaining all sentences from the training essays.\n", 556 | " sentences += essay_to_sentences(essay, remove_stopwords = True)\n", 557 | " \n", 558 | " # Initializing variables for word2vec model.\n", 559 | " num_features = 300 \n", 560 | " min_word_count = 40\n", 561 | " num_workers = 4\n", 562 | " context = 10\n", 563 | " downsampling = 1e-3\n", 564 | "\n", 565 | " print(\"Training Word2Vec Model...\")\n", 566 | " model = Word2Vec(sentences, workers=num_workers, size=num_features, min_count = min_word_count, window = context, sample = downsampling)\n", 567 | "\n", 568 | " model.init_sims(replace=True)\n", 569 | " model.wv.save_word2vec_format('word2vecmodel.bin', binary=True)\n", 570 | "\n", 571 | " clean_train_essays = []\n", 572 | " \n", 573 | " # Generate training and testing data word vectors.\n", 574 | " for essay_v in train_essays:\n", 575 | " clean_train_essays.append(essay_to_wordlist(essay_v, remove_stopwords=True))\n", 576 | " trainDataVecs = getAvgFeatureVecs(clean_train_essays, model, num_features)\n", 577 | " \n", 578 | " clean_test_essays = []\n", 579 | " for essay_v in test_essays:\n", 580 | " clean_test_essays.append(essay_to_wordlist( essay_v, remove_stopwords=True ))\n", 581 | " testDataVecs = getAvgFeatureVecs( clean_test_essays, model, num_features )\n", 582 | " \n", 583 | " trainDataVecs = np.array(trainDataVecs)\n", 584 | " testDataVecs = np.array(testDataVecs)\n", 585 | " # Reshaping train and test vectors to 3 dimensions. (1 represnts one timestep)\n", 586 | " trainDataVecs = np.reshape(trainDataVecs, (trainDataVecs.shape[0], 1, trainDataVecs.shape[1]))\n", 587 | " testDataVecs = np.reshape(testDataVecs, (testDataVecs.shape[0], 1, testDataVecs.shape[1]))\n", 588 | " \n", 589 | " lstm_model = get_model()\n", 590 | " lstm_model.fit(trainDataVecs, y_train, batch_size=64, epochs=2)\n", 591 | " #lstm_model.load_weights('./model_weights/final_lstm.h5')\n", 592 | " y_pred = lstm_model.predict(testDataVecs)\n", 593 | " \n", 594 | " # Save any one of the 5 models.\n", 595 | " if count == 5:\n", 596 | " lstm_model.save('./model_weights/final_lstm.h5')\n", 597 | " \n", 598 | " # Round y_pred to the nearest integer.\n", 599 | " y_pred = np.around(y_pred)\n", 600 | " \n", 601 | " # Evaluate the model on the evaluation metric. \"Quadratic mean averaged Kappa\"\n", 602 | " result = cohen_kappa_score(y_test.values,y_pred,weights='quadratic')\n", 603 | " print(\"Kappa Score: {}\".format(result))\n", 604 | " results.append(result)\n", 605 | "\n", 606 | " count += 1\n", 607 | " " 608 | ] 609 | }, 610 | { 611 | "cell_type": "code", 612 | "execution_count": 9, 613 | "metadata": {}, 614 | "outputs": [ 615 | { 616 | "name": "stdout", 617 | "output_type": "stream", 618 | "text": [ 619 | "Average Kappa score after a 5-fold cross validation: 0.7441\n" 620 | ] 621 | } 622 | ], 623 | "source": [ 624 | "print(\"Average Kappa score after a 5-fold cross validation: \",np.around(np.array(results).mean(),decimals=4))" 625 | ] 626 | }, 627 | { 628 | "cell_type": "code", 629 | "execution_count": null, 630 | "metadata": {}, 631 | "outputs": [], 632 | "source": [] 633 | } 634 | ], 635 | "metadata": { 636 | "kernelspec": { 637 | "display_name": "Python 3", 638 | "language": "python", 639 | "name": "python3" 640 | }, 641 | "language_info": { 642 | "codemirror_mode": { 643 | "name": "ipython", 644 | "version": 3 645 | }, 646 | "file_extension": ".py", 647 | "mimetype": "text/x-python", 648 | "name": "python", 649 | "nbconvert_exporter": "python", 650 | "pygments_lexer": "ipython3", 651 | "version": "3.7.5" 652 | } 653 | }, 654 | "nbformat": 4, 655 | "nbformat_minor": 2 656 | } 657 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Automated Essay Scoring 2 | > A Deep Learning model that predicts the score of a given input essay. 3 | 4 | The dataset is from Kaggle ASAP competition which was provided by The Hewlett Foundation. 5 | 6 | The **mysite** folder contains the Django app if you want an interactive demo. 7 | 8 | ### Performance 9 | The accuracy is calculated by **Quadratic Weighted Kappa(QWK)**, which measures the agreement between two raters. The model architecture consists of 2 Long Short Term Memory(LSTM) layers with a Dense output layer. The final layer uses the Relu activation function. The QWK is calculated by training model on the dataset using 5-Fold Cross Validation and taking the average for all five folds. 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | ## Requirements 18 | - Tensorflow 1.9 19 | - Keras 2.2.2 20 | - Django 2.1 21 | - Gensim 3.5 22 | 23 | ``` 24 | pip install tensorflow 25 | pip install keras 26 | pip install django 27 | pip install gensim 28 | 29 | ``` 30 | 31 | ## Installation 32 | - Clone the repo 33 | - Just run the **Jupyter Notebook** to train the model. 34 | - To run the Django App cd ./ into the **mysite** folder and run 35 | ``` 36 | python manage.py migrate 37 | python manage.py runserver 38 | ``` 39 | 40 | ## References 41 | 1. [A Neural Approach to Automated Essay Scoring](http://aclweb.org/anthology/D/D16/D16-1193.pdf)
42 | 2. [Automatic Text Scoring Using Neural Networks](https://arxiv.org/pdf/1606.04289.pdf) 43 | -------------------------------------------------------------------------------- /ScreenShots/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/ScreenShots/.DS_Store -------------------------------------------------------------------------------- /ScreenShots/SC1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/ScreenShots/SC1.png -------------------------------------------------------------------------------- /ScreenShots/SC2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/ScreenShots/SC2.png -------------------------------------------------------------------------------- /ScreenShots/SC3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/ScreenShots/SC3.png -------------------------------------------------------------------------------- /Training LSTM Model.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## Importing the Data" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": 1, 13 | "metadata": {}, 14 | "outputs": [], 15 | "source": [ 16 | "# Constants\n", 17 | "DATASET_DIR = './data/'\n", 18 | "GLOVE_DIR = './glove.6B/'\n", 19 | "SAVE_DIR = './'\n", 20 | "\n", 21 | "import os\n", 22 | "import pandas as pd\n", 23 | "\n", 24 | "X = pd.read_csv(os.path.join(DATASET_DIR, 'training_set_rel3.tsv'), sep='\\t', encoding='ISO-8859-1')\n", 25 | "y = X['domain1_score']\n", 26 | "X = X.dropna(axis=1)\n", 27 | "X = X.drop(columns=['rater1_domain1', 'rater2_domain1'])" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": 2, 33 | "metadata": {}, 34 | "outputs": [ 35 | { 36 | "data": { 37 | "text/html": [ 38 | "
\n", 39 | "\n", 52 | "\n", 53 | " \n", 54 | " \n", 55 | " \n", 56 | " \n", 57 | " \n", 58 | " \n", 59 | " \n", 60 | " \n", 61 | " \n", 62 | " \n", 63 | " \n", 64 | " \n", 65 | " \n", 66 | " \n", 67 | " \n", 68 | " \n", 69 | " \n", 70 | " \n", 71 | " \n", 72 | " \n", 73 | " \n", 74 | " \n", 75 | " \n", 76 | " \n", 77 | " \n", 78 | " \n", 79 | " \n", 80 | " \n", 81 | " \n", 82 | " \n", 83 | " \n", 84 | " \n", 85 | " \n", 86 | " \n", 87 | " \n", 88 | " \n", 89 | " \n", 90 | " \n", 91 | " \n", 92 | " \n", 93 | " \n", 94 | " \n", 95 | " \n", 96 | " \n", 97 | " \n", 98 | " \n", 99 | "
essay_idessay_setessaydomain1_score
011Dear local newspaper, I think effects computer...8
121Dear @CAPS1 @CAPS2, I believe that using compu...9
231Dear, @CAPS1 @CAPS2 @CAPS3 More and more peopl...7
341Dear Local Newspaper, @CAPS1 I have found that...10
451Dear @LOCATION1, I know having computers has a...8
\n", 100 | "
" 101 | ], 102 | "text/plain": [ 103 | " essay_id essay_set essay \\\n", 104 | "0 1 1 Dear local newspaper, I think effects computer... \n", 105 | "1 2 1 Dear @CAPS1 @CAPS2, I believe that using compu... \n", 106 | "2 3 1 Dear, @CAPS1 @CAPS2 @CAPS3 More and more peopl... \n", 107 | "3 4 1 Dear Local Newspaper, @CAPS1 I have found that... \n", 108 | "4 5 1 Dear @LOCATION1, I know having computers has a... \n", 109 | "\n", 110 | " domain1_score \n", 111 | "0 8 \n", 112 | "1 9 \n", 113 | "2 7 \n", 114 | "3 10 \n", 115 | "4 8 " 116 | ] 117 | }, 118 | "execution_count": 2, 119 | "metadata": {}, 120 | "output_type": "execute_result" 121 | } 122 | ], 123 | "source": [ 124 | "X.head()" 125 | ] 126 | }, 127 | { 128 | "cell_type": "markdown", 129 | "metadata": {}, 130 | "source": [ 131 | "Minimum and Maximum Scores for each essay set." 132 | ] 133 | }, 134 | { 135 | "cell_type": "code", 136 | "execution_count": 3, 137 | "metadata": {}, 138 | "outputs": [], 139 | "source": [ 140 | "minimum_scores = [-1, 2, 1, 0, 0, 0, 0, 0, 0]\n", 141 | "maximum_scores = [-1, 12, 6, 3, 3, 4, 4, 30, 60]" 142 | ] 143 | }, 144 | { 145 | "cell_type": "markdown", 146 | "metadata": {}, 147 | "source": [ 148 | "## Preprocessing the Data" 149 | ] 150 | }, 151 | { 152 | "cell_type": "markdown", 153 | "metadata": {}, 154 | "source": [ 155 | "We will preprocess all essays and convert them to feature vectors so that they can be fed into the RNN.\n", 156 | "\n", 157 | "These are all helper functions used to clean the essays." 158 | ] 159 | }, 160 | { 161 | "cell_type": "code", 162 | "execution_count": 4, 163 | "metadata": {}, 164 | "outputs": [], 165 | "source": [ 166 | "import numpy as np\n", 167 | "import nltk\n", 168 | "import re\n", 169 | "from nltk.corpus import stopwords\n", 170 | "from gensim.models import Word2Vec\n", 171 | "\n", 172 | "def essay_to_wordlist(essay_v, remove_stopwords):\n", 173 | " \"\"\"Remove the tagged labels and word tokenize the sentence.\"\"\"\n", 174 | " essay_v = re.sub(\"[^a-zA-Z]\", \" \", essay_v)\n", 175 | " words = essay_v.lower().split()\n", 176 | " if remove_stopwords:\n", 177 | " stops = set(stopwords.words(\"english\"))\n", 178 | " words = [w for w in words if not w in stops]\n", 179 | " return (words)\n", 180 | "\n", 181 | "def essay_to_sentences(essay_v, remove_stopwords):\n", 182 | " \"\"\"Sentence tokenize the essay and call essay_to_wordlist() for word tokenization.\"\"\"\n", 183 | " tokenizer = nltk.data.load('tokenizers/punkt/english.pickle')\n", 184 | " raw_sentences = tokenizer.tokenize(essay_v.strip())\n", 185 | " sentences = []\n", 186 | " for raw_sentence in raw_sentences:\n", 187 | " if len(raw_sentence) > 0:\n", 188 | " sentences.append(essay_to_wordlist(raw_sentence, remove_stopwords))\n", 189 | " return sentences\n", 190 | "\n", 191 | "def makeFeatureVec(words, model, num_features):\n", 192 | " \"\"\"Make Feature Vector from the words list of an Essay.\"\"\"\n", 193 | " featureVec = np.zeros((num_features,),dtype=\"float32\")\n", 194 | " num_words = 0.\n", 195 | " index2word_set = set(model.wv.index2word)\n", 196 | " for word in words:\n", 197 | " if word in index2word_set:\n", 198 | " num_words += 1\n", 199 | " featureVec = np.add(featureVec,model[word]) \n", 200 | " featureVec = np.divide(featureVec,num_words)\n", 201 | " return featureVec\n", 202 | "\n", 203 | "def getAvgFeatureVecs(essays, model, num_features):\n", 204 | " \"\"\"Main function to generate the word vectors for word2vec model.\"\"\"\n", 205 | " counter = 0\n", 206 | " essayFeatureVecs = np.zeros((len(essays),num_features),dtype=\"float32\")\n", 207 | " for essay in essays:\n", 208 | " essayFeatureVecs[counter] = makeFeatureVec(essay, model, num_features)\n", 209 | " counter = counter + 1\n", 210 | " return essayFeatureVecs" 211 | ] 212 | }, 213 | { 214 | "cell_type": "code", 215 | "execution_count": 5, 216 | "metadata": {}, 217 | "outputs": [ 218 | { 219 | "name": "stderr", 220 | "output_type": "stream", 221 | "text": [ 222 | "[nltk_data] Downloading package stopwords to /home/ronit/nltk_data...\n", 223 | "[nltk_data] Package stopwords is already up-to-date!\n" 224 | ] 225 | }, 226 | { 227 | "data": { 228 | "text/plain": [ 229 | "True" 230 | ] 231 | }, 232 | "execution_count": 5, 233 | "metadata": {}, 234 | "output_type": "execute_result" 235 | } 236 | ], 237 | "source": [ 238 | "import nltk\n", 239 | "\n", 240 | "nltk.download('stopwords')" 241 | ] 242 | }, 243 | { 244 | "cell_type": "markdown", 245 | "metadata": {}, 246 | "source": [ 247 | "## Defining the model " 248 | ] 249 | }, 250 | { 251 | "cell_type": "markdown", 252 | "metadata": {}, 253 | "source": [ 254 | "Here we define a 2-Layer LSTM Model. \n", 255 | "\n", 256 | "Note that instead of using sigmoid activation in the output layer we will use\n", 257 | "Relu since we are not normalising training labels." 258 | ] 259 | }, 260 | { 261 | "cell_type": "code", 262 | "execution_count": 6, 263 | "metadata": {}, 264 | "outputs": [ 265 | { 266 | "name": "stderr", 267 | "output_type": "stream", 268 | "text": [ 269 | "Using TensorFlow backend.\n", 270 | "/home/ronit/.local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 271 | " _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\n", 272 | "/home/ronit/.local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 273 | " _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\n", 274 | "/home/ronit/.local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 275 | " _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\n", 276 | "/home/ronit/.local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 277 | " _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\n", 278 | "/home/ronit/.local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 279 | " _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\n", 280 | "/home/ronit/.local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 281 | " np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\n", 282 | "/home/ronit/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 283 | " _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\n", 284 | "/home/ronit/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 285 | " _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\n", 286 | "/home/ronit/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 287 | " _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\n", 288 | "/home/ronit/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 289 | " _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\n", 290 | "/home/ronit/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 291 | " _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\n", 292 | "/home/ronit/.local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 293 | " np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\n" 294 | ] 295 | } 296 | ], 297 | "source": [ 298 | "from keras.layers import Embedding, LSTM, Dense, Dropout, Lambda, Flatten\n", 299 | "from keras.models import Sequential, load_model, model_from_config\n", 300 | "import keras.backend as K\n", 301 | "\n", 302 | "def get_model():\n", 303 | " \"\"\"Define the model.\"\"\"\n", 304 | " model = Sequential()\n", 305 | " model.add(LSTM(300, dropout=0.4, recurrent_dropout=0.4, input_shape=[1, 300], return_sequences=True))\n", 306 | " model.add(LSTM(64, recurrent_dropout=0.4))\n", 307 | " model.add(Dropout(0.5))\n", 308 | " model.add(Dense(1, activation='relu'))\n", 309 | "\n", 310 | " model.compile(loss='mean_squared_error', optimizer='rmsprop', metrics=['mae'])\n", 311 | " model.summary()\n", 312 | "\n", 313 | " return model" 314 | ] 315 | }, 316 | { 317 | "cell_type": "markdown", 318 | "metadata": {}, 319 | "source": [ 320 | "## Training Phase" 321 | ] 322 | }, 323 | { 324 | "cell_type": "markdown", 325 | "metadata": {}, 326 | "source": [ 327 | "Now we train the model on the dataset.\n", 328 | "\n", 329 | "We will use 5-Fold Cross Validation and measure the Quadratic Weighted Kappa for each fold.\n", 330 | "We will then calculate Average Kappa for all the folds." 331 | ] 332 | }, 333 | { 334 | "cell_type": "code", 335 | "execution_count": 8, 336 | "metadata": {}, 337 | "outputs": [ 338 | { 339 | "name": "stdout", 340 | "output_type": "stream", 341 | "text": [ 342 | "\n", 343 | "--------Fold 1--------\n", 344 | "\n", 345 | "Training Word2Vec Model...\n" 346 | ] 347 | }, 348 | { 349 | "name": "stderr", 350 | "output_type": "stream", 351 | "text": [ 352 | "/home/ronit/.local/lib/python3.7/site-packages/ipykernel_launcher.py:34: DeprecationWarning: Call to deprecated `__getitem__` (Method will be removed in 4.0.0, use self.wv.__getitem__() instead).\n" 353 | ] 354 | }, 355 | { 356 | "name": "stdout", 357 | "output_type": "stream", 358 | "text": [ 359 | "Model: \"sequential_2\"\n", 360 | "_________________________________________________________________\n", 361 | "Layer (type) Output Shape Param # \n", 362 | "=================================================================\n", 363 | "lstm_3 (LSTM) (None, 1, 300) 721200 \n", 364 | "_________________________________________________________________\n", 365 | "lstm_4 (LSTM) (None, 64) 93440 \n", 366 | "_________________________________________________________________\n", 367 | "dropout_2 (Dropout) (None, 64) 0 \n", 368 | "_________________________________________________________________\n", 369 | "dense_2 (Dense) (None, 1) 65 \n", 370 | "=================================================================\n", 371 | "Total params: 814,705\n", 372 | "Trainable params: 814,705\n", 373 | "Non-trainable params: 0\n", 374 | "_________________________________________________________________\n", 375 | "Epoch 1/2\n", 376 | "10380/10380 [==============================] - 3s 242us/step - loss: 65.0803 - mae: 4.4190\n", 377 | "Epoch 2/2\n", 378 | "10380/10380 [==============================] - 2s 216us/step - loss: 41.0397 - mae: 3.6236\n", 379 | "Kappa Score: 0.7486217099570918\n", 380 | "\n", 381 | "--------Fold 2--------\n", 382 | "\n", 383 | "Training Word2Vec Model...\n" 384 | ] 385 | }, 386 | { 387 | "name": "stderr", 388 | "output_type": "stream", 389 | "text": [ 390 | "/home/ronit/.local/lib/python3.7/site-packages/ipykernel_launcher.py:34: DeprecationWarning: Call to deprecated `__getitem__` (Method will be removed in 4.0.0, use self.wv.__getitem__() instead).\n" 391 | ] 392 | }, 393 | { 394 | "name": "stdout", 395 | "output_type": "stream", 396 | "text": [ 397 | "Model: \"sequential_3\"\n", 398 | "_________________________________________________________________\n", 399 | "Layer (type) Output Shape Param # \n", 400 | "=================================================================\n", 401 | "lstm_5 (LSTM) (None, 1, 300) 721200 \n", 402 | "_________________________________________________________________\n", 403 | "lstm_6 (LSTM) (None, 64) 93440 \n", 404 | "_________________________________________________________________\n", 405 | "dropout_3 (Dropout) (None, 64) 0 \n", 406 | "_________________________________________________________________\n", 407 | "dense_3 (Dense) (None, 1) 65 \n", 408 | "=================================================================\n", 409 | "Total params: 814,705\n", 410 | "Trainable params: 814,705\n", 411 | "Non-trainable params: 0\n", 412 | "_________________________________________________________________\n", 413 | "Epoch 1/2\n", 414 | "10381/10381 [==============================] - 3s 251us/step - loss: 62.8194 - mae: 4.3238\n", 415 | "Epoch 2/2\n", 416 | "10381/10381 [==============================] - 2s 216us/step - loss: 40.3073 - mae: 3.6031\n", 417 | "Kappa Score: 0.7366845373546059\n", 418 | "\n", 419 | "--------Fold 3--------\n", 420 | "\n", 421 | "Training Word2Vec Model...\n" 422 | ] 423 | }, 424 | { 425 | "name": "stderr", 426 | "output_type": "stream", 427 | "text": [ 428 | "/home/ronit/.local/lib/python3.7/site-packages/ipykernel_launcher.py:34: DeprecationWarning: Call to deprecated `__getitem__` (Method will be removed in 4.0.0, use self.wv.__getitem__() instead).\n" 429 | ] 430 | }, 431 | { 432 | "name": "stdout", 433 | "output_type": "stream", 434 | "text": [ 435 | "Model: \"sequential_4\"\n", 436 | "_________________________________________________________________\n", 437 | "Layer (type) Output Shape Param # \n", 438 | "=================================================================\n", 439 | "lstm_7 (LSTM) (None, 1, 300) 721200 \n", 440 | "_________________________________________________________________\n", 441 | "lstm_8 (LSTM) (None, 64) 93440 \n", 442 | "_________________________________________________________________\n", 443 | "dropout_4 (Dropout) (None, 64) 0 \n", 444 | "_________________________________________________________________\n", 445 | "dense_4 (Dense) (None, 1) 65 \n", 446 | "=================================================================\n", 447 | "Total params: 814,705\n", 448 | "Trainable params: 814,705\n", 449 | "Non-trainable params: 0\n", 450 | "_________________________________________________________________\n", 451 | "Epoch 1/2\n", 452 | "10381/10381 [==============================] - 3s 246us/step - loss: 63.6039 - mae: 4.3544\n", 453 | "Epoch 2/2\n", 454 | "10381/10381 [==============================] - 2s 212us/step - loss: 40.6817 - mae: 3.6181\n", 455 | "Kappa Score: 0.750224807720522\n", 456 | "\n", 457 | "--------Fold 4--------\n", 458 | "\n", 459 | "Training Word2Vec Model...\n" 460 | ] 461 | }, 462 | { 463 | "name": "stderr", 464 | "output_type": "stream", 465 | "text": [ 466 | "/home/ronit/.local/lib/python3.7/site-packages/ipykernel_launcher.py:34: DeprecationWarning: Call to deprecated `__getitem__` (Method will be removed in 4.0.0, use self.wv.__getitem__() instead).\n" 467 | ] 468 | }, 469 | { 470 | "name": "stdout", 471 | "output_type": "stream", 472 | "text": [ 473 | "Model: \"sequential_5\"\n", 474 | "_________________________________________________________________\n", 475 | "Layer (type) Output Shape Param # \n", 476 | "=================================================================\n", 477 | "lstm_9 (LSTM) (None, 1, 300) 721200 \n", 478 | "_________________________________________________________________\n", 479 | "lstm_10 (LSTM) (None, 64) 93440 \n", 480 | "_________________________________________________________________\n", 481 | "dropout_5 (Dropout) (None, 64) 0 \n", 482 | "_________________________________________________________________\n", 483 | "dense_5 (Dense) (None, 1) 65 \n", 484 | "=================================================================\n", 485 | "Total params: 814,705\n", 486 | "Trainable params: 814,705\n", 487 | "Non-trainable params: 0\n", 488 | "_________________________________________________________________\n", 489 | "Epoch 1/2\n", 490 | "10381/10381 [==============================] - 2s 232us/step - loss: 64.4470 - mae: 4.3468\n", 491 | "Epoch 2/2\n", 492 | "10381/10381 [==============================] - 3s 244us/step - loss: 39.5856 - mae: 3.5689\n", 493 | "Kappa Score: 0.7365923618977773\n", 494 | "\n", 495 | "--------Fold 5--------\n", 496 | "\n", 497 | "Training Word2Vec Model...\n" 498 | ] 499 | }, 500 | { 501 | "name": "stderr", 502 | "output_type": "stream", 503 | "text": [ 504 | "/home/ronit/.local/lib/python3.7/site-packages/ipykernel_launcher.py:34: DeprecationWarning: Call to deprecated `__getitem__` (Method will be removed in 4.0.0, use self.wv.__getitem__() instead).\n" 505 | ] 506 | }, 507 | { 508 | "name": "stdout", 509 | "output_type": "stream", 510 | "text": [ 511 | "Model: \"sequential_6\"\n", 512 | "_________________________________________________________________\n", 513 | "Layer (type) Output Shape Param # \n", 514 | "=================================================================\n", 515 | "lstm_11 (LSTM) (None, 1, 300) 721200 \n", 516 | "_________________________________________________________________\n", 517 | "lstm_12 (LSTM) (None, 64) 93440 \n", 518 | "_________________________________________________________________\n", 519 | "dropout_6 (Dropout) (None, 64) 0 \n", 520 | "_________________________________________________________________\n", 521 | "dense_6 (Dense) (None, 1) 65 \n", 522 | "=================================================================\n", 523 | "Total params: 814,705\n", 524 | "Trainable params: 814,705\n", 525 | "Non-trainable params: 0\n", 526 | "_________________________________________________________________\n", 527 | "Epoch 1/2\n", 528 | "10381/10381 [==============================] - 3s 252us/step - loss: 63.9294 - mae: 4.3457\n", 529 | "Epoch 2/2\n", 530 | "10381/10381 [==============================] - 2s 184us/step - loss: 39.9797 - mae: 3.6093\n", 531 | "Kappa Score: 0.7484117718081168\n" 532 | ] 533 | } 534 | ], 535 | "source": [ 536 | "from sklearn.model_selection import KFold\n", 537 | "from sklearn.linear_model import LinearRegression\n", 538 | "from sklearn.metrics import cohen_kappa_score\n", 539 | "\n", 540 | "cv = KFold(n_splits = 5, shuffle = True)\n", 541 | "results = []\n", 542 | "y_pred_list = []\n", 543 | "\n", 544 | "count = 1\n", 545 | "for traincv, testcv in cv.split(X):\n", 546 | " print(\"\\n--------Fold {}--------\\n\".format(count))\n", 547 | " X_test, X_train, y_test, y_train = X.iloc[testcv], X.iloc[traincv], y.iloc[testcv], y.iloc[traincv]\n", 548 | " \n", 549 | " train_essays = X_train['essay']\n", 550 | " test_essays = X_test['essay']\n", 551 | " \n", 552 | " sentences = []\n", 553 | " \n", 554 | " for essay in train_essays:\n", 555 | " # Obtaining all sentences from the training essays.\n", 556 | " sentences += essay_to_sentences(essay, remove_stopwords = True)\n", 557 | " \n", 558 | " # Initializing variables for word2vec model.\n", 559 | " num_features = 300 \n", 560 | " min_word_count = 40\n", 561 | " num_workers = 4\n", 562 | " context = 10\n", 563 | " downsampling = 1e-3\n", 564 | "\n", 565 | " print(\"Training Word2Vec Model...\")\n", 566 | " model = Word2Vec(sentences, workers=num_workers, size=num_features, min_count = min_word_count, window = context, sample = downsampling)\n", 567 | "\n", 568 | " model.init_sims(replace=True)\n", 569 | " model.wv.save_word2vec_format('word2vecmodel.bin', binary=True)\n", 570 | "\n", 571 | " clean_train_essays = []\n", 572 | " \n", 573 | " # Generate training and testing data word vectors.\n", 574 | " for essay_v in train_essays:\n", 575 | " clean_train_essays.append(essay_to_wordlist(essay_v, remove_stopwords=True))\n", 576 | " trainDataVecs = getAvgFeatureVecs(clean_train_essays, model, num_features)\n", 577 | " \n", 578 | " clean_test_essays = []\n", 579 | " for essay_v in test_essays:\n", 580 | " clean_test_essays.append(essay_to_wordlist( essay_v, remove_stopwords=True ))\n", 581 | " testDataVecs = getAvgFeatureVecs( clean_test_essays, model, num_features )\n", 582 | " \n", 583 | " trainDataVecs = np.array(trainDataVecs)\n", 584 | " testDataVecs = np.array(testDataVecs)\n", 585 | " # Reshaping train and test vectors to 3 dimensions. (1 represnts one timestep)\n", 586 | " trainDataVecs = np.reshape(trainDataVecs, (trainDataVecs.shape[0], 1, trainDataVecs.shape[1]))\n", 587 | " testDataVecs = np.reshape(testDataVecs, (testDataVecs.shape[0], 1, testDataVecs.shape[1]))\n", 588 | " \n", 589 | " lstm_model = get_model()\n", 590 | " lstm_model.fit(trainDataVecs, y_train, batch_size=64, epochs=2)\n", 591 | " #lstm_model.load_weights('./model_weights/final_lstm.h5')\n", 592 | " y_pred = lstm_model.predict(testDataVecs)\n", 593 | " \n", 594 | " # Save any one of the 5 models.\n", 595 | " if count == 5:\n", 596 | " lstm_model.save('./model_weights/final_lstm.h5')\n", 597 | " \n", 598 | " # Round y_pred to the nearest integer.\n", 599 | " y_pred = np.around(y_pred)\n", 600 | " \n", 601 | " # Evaluate the model on the evaluation metric. \"Quadratic mean averaged Kappa\"\n", 602 | " result = cohen_kappa_score(y_test.values,y_pred,weights='quadratic')\n", 603 | " print(\"Kappa Score: {}\".format(result))\n", 604 | " results.append(result)\n", 605 | "\n", 606 | " count += 1\n", 607 | " " 608 | ] 609 | }, 610 | { 611 | "cell_type": "code", 612 | "execution_count": 9, 613 | "metadata": {}, 614 | "outputs": [ 615 | { 616 | "name": "stdout", 617 | "output_type": "stream", 618 | "text": [ 619 | "Average Kappa score after a 5-fold cross validation: 0.7441\n" 620 | ] 621 | } 622 | ], 623 | "source": [ 624 | "print(\"Average Kappa score after a 5-fold cross validation: \",np.around(np.array(results).mean(),decimals=4))" 625 | ] 626 | }, 627 | { 628 | "cell_type": "code", 629 | "execution_count": null, 630 | "metadata": {}, 631 | "outputs": [], 632 | "source": [] 633 | } 634 | ], 635 | "metadata": { 636 | "kernelspec": { 637 | "display_name": "Python 3", 638 | "language": "python", 639 | "name": "python3" 640 | }, 641 | "language_info": { 642 | "codemirror_mode": { 643 | "name": "ipython", 644 | "version": 3 645 | }, 646 | "file_extension": ".py", 647 | "mimetype": "text/x-python", 648 | "name": "python", 649 | "nbconvert_exporter": "python", 650 | "pygments_lexer": "ipython3", 651 | "version": "3.7.5" 652 | } 653 | }, 654 | "nbformat": 4, 655 | "nbformat_minor": 2 656 | } 657 | -------------------------------------------------------------------------------- /data/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/.DS_Store -------------------------------------------------------------------------------- /data/Essay_Set_Descriptions.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/Essay_Set_Descriptions.zip -------------------------------------------------------------------------------- /data/Essay_Set_Descriptions/Essay Set #1--ReadMeFirst.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/Essay_Set_Descriptions/Essay Set #1--ReadMeFirst.docx -------------------------------------------------------------------------------- /data/Essay_Set_Descriptions/Essay Set #2--ReadMeFirst.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/Essay_Set_Descriptions/Essay Set #2--ReadMeFirst.docx -------------------------------------------------------------------------------- /data/Essay_Set_Descriptions/Essay Set #3--ReadMeFirst.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/Essay_Set_Descriptions/Essay Set #3--ReadMeFirst.docx -------------------------------------------------------------------------------- /data/Essay_Set_Descriptions/Essay Set #4--ReadMeFirst.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/Essay_Set_Descriptions/Essay Set #4--ReadMeFirst.docx -------------------------------------------------------------------------------- /data/Essay_Set_Descriptions/Essay Set #5--ReadMeFirst.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/Essay_Set_Descriptions/Essay Set #5--ReadMeFirst.docx -------------------------------------------------------------------------------- /data/Essay_Set_Descriptions/Essay Set #6--ReadMeFirst.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/Essay_Set_Descriptions/Essay Set #6--ReadMeFirst.docx -------------------------------------------------------------------------------- /data/Essay_Set_Descriptions/Essay Set #7--ReadMeFirst.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/Essay_Set_Descriptions/Essay Set #7--ReadMeFirst.docx -------------------------------------------------------------------------------- /data/Essay_Set_Descriptions/Essay Set #8--ReadMeFirst.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/Essay_Set_Descriptions/Essay Set #8--ReadMeFirst.docx -------------------------------------------------------------------------------- /data/Essay_Set_Descriptions/Guidelines for Transcribing Student Essays.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/Essay_Set_Descriptions/Guidelines for Transcribing Student Essays.docx -------------------------------------------------------------------------------- /data/Essay_Set_Descriptions/essay_set_descriptions.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/Essay_Set_Descriptions/essay_set_descriptions.xlsx -------------------------------------------------------------------------------- /data/Training_Materials.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/Training_Materials.zip -------------------------------------------------------------------------------- /data/test_set.tsv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/test_set.tsv -------------------------------------------------------------------------------- /data/training_set_rel3.tsv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/training_set_rel3.tsv -------------------------------------------------------------------------------- /data/training_set_rel3.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/training_set_rel3.xls -------------------------------------------------------------------------------- /data/training_set_rel3.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/training_set_rel3.xlsx -------------------------------------------------------------------------------- /data/valid_set.tsv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/valid_set.tsv -------------------------------------------------------------------------------- /data/valid_set.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/valid_set.xls -------------------------------------------------------------------------------- /data/valid_set.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/data/valid_set.xlsx -------------------------------------------------------------------------------- /model_weights/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/model_weights/.DS_Store -------------------------------------------------------------------------------- /model_weights/final_lstm.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/model_weights/final_lstm.h5 -------------------------------------------------------------------------------- /models/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/models/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /models/__pycache__/blstm.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/models/__pycache__/blstm.cpython-36.pyc -------------------------------------------------------------------------------- /models/__pycache__/cnn_lstm.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/models/__pycache__/cnn_lstm.cpython-36.pyc -------------------------------------------------------------------------------- /models/__pycache__/cnn_lstm_mot.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/models/__pycache__/cnn_lstm_mot.cpython-36.pyc -------------------------------------------------------------------------------- /models/__pycache__/feed_forward.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/models/__pycache__/feed_forward.cpython-36.pyc -------------------------------------------------------------------------------- /models/__pycache__/lstm.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/models/__pycache__/lstm.cpython-36.pyc -------------------------------------------------------------------------------- /models/__pycache__/lstm_mot.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/models/__pycache__/lstm_mot.cpython-36.pyc -------------------------------------------------------------------------------- /models/blstm.py: -------------------------------------------------------------------------------- 1 | from constants import GLOVE_DIR 2 | from keras.layers import Embedding, LSTM, Dense, Dropout, Bidirectional 3 | from keras.models import Sequential 4 | from utils import tokenizer, load_embedding_matrix 5 | 6 | def get_model(embedding_dimension, essay_length): 7 | vocabulary_size = len(tokenizer.word_index) + 1 8 | embedding_matrix = load_embedding_matrix(glove_directory=GLOVE_DIR, embedding_dimension=embedding_dimension) 9 | 10 | model = Sequential() 11 | 12 | model.add(Embedding(vocabulary_size, embedding_dimension, weights=[embedding_matrix], input_length=essay_length, trainable=False, mask_zero=False)) 13 | model.add(LSTM(64, dropout=0.4, recurrent_dropout=0.4, return_sequences=True)) 14 | model.add(Dropout(0.4)) 15 | model.add(LSTM(256, dropout=0.4, recurrent_dropout=0.4)) 16 | model.add(Dropout(0.4)) 17 | model.add(Dense(1, activation='sigmoid')) 18 | 19 | model.compile(loss='mean_squared_error', optimizer='adam', metrics=['mae']) 20 | model.summary() 21 | 22 | return model -------------------------------------------------------------------------------- /models/cnn_lstm.py: -------------------------------------------------------------------------------- 1 | from constants import GLOVE_DIR 2 | from keras.layers import Embedding, LSTM, Dense, Dropout, Conv1D, Lambda, Flatten, MaxPooling1D 3 | from keras.models import Sequential 4 | import keras.regularizers 5 | import keras.backend as K 6 | from utils import tokenizer, load_embedding_matrix 7 | 8 | def get_model(embedding_dimension, essay_length): 9 | """ 10 | Returns compiled model. 11 | """ 12 | vocabulary_size = len(tokenizer.word_index) + 1 13 | embedding_matrix = load_embedding_matrix(GLOVE_DIR, embedding_dimension) 14 | 15 | model = Sequential() 16 | model.add(Embedding(vocabulary_size, embedding_dimension, weights=[embedding_matrix], input_length=essay_length, trainable=False, mask_zero=False)) 17 | # model.add(Conv1D(filters=50, kernel_size=5, padding='same')) 18 | # model.add(LSTM(300, dropout=0.4, recurrent_dropout=0.4, return_sequences=True)) 19 | # model.add(Dropout(0.4)) 20 | # model.add(Lambda(lambda x: K.mean(x, axis=1, keepdims=True))) 21 | model.add(Conv1D(filters=50, kernel_size=5, padding='same')) 22 | model.add(MaxPooling1D(2)) 23 | model.add(Flatten()) 24 | model.add(Dense(128, activation='relu')) 25 | model.add(Dropout(0.5)) 26 | model.add(Dense(1, activation='sigmoid', activity_regularizer=keras.regularizers.l2(0.0))) 27 | model.compile(loss='mean_squared_error', optimizer='adam') 28 | 29 | return model -------------------------------------------------------------------------------- /models/cnn_lstm_mot.py: -------------------------------------------------------------------------------- 1 | from constants import GLOVE_DIR 2 | from keras.layers import Embedding, LSTM, Dense, Dropout, Lambda, Flatten 3 | from keras.models import Sequential 4 | from layers import Conv1DWithMasking 5 | import keras.regularizers 6 | import keras.backend as K 7 | from utils import tokenizer, load_embedding_matrix 8 | 9 | def get_model(embedding_dimension, essay_length): 10 | """ 11 | Returns compiled model. 12 | """ 13 | vocabulary_size = len(tokenizer.word_index) + 1 14 | embedding_matrix = load_embedding_matrix(glove_directory=GLOVE_DIR, embedding_dimension=embedding_dimension) 15 | model = Sequential() 16 | model.add(Embedding(vocabulary_size, embedding_dimension, weights=[embedding_matrix], input_length=essay_length, trainable=True, mask_zero=True)) 17 | model.add(Conv1DWithMasking(nb_filter=64, filter_length=3, border_mode='same', subsample_length=1)) 18 | model.add(LSTM(128, dropout=0.4, recurrent_dropout=0.4, return_sequences=False)) 19 | model.add(Dropout(0.4)) 20 | model.add(Lambda(lambda x: K.mean(x, axis=1, keepdims=True))) 21 | model.add(Dense(1, activation='sigmoid', activity_regularizer=keras.regularizers.l2(0.0))) 22 | model.compile(loss='mse', optimizer='rmsprop') 23 | 24 | return model -------------------------------------------------------------------------------- /models/feed_forward.py: -------------------------------------------------------------------------------- 1 | from constants import GLOVE_DIR 2 | from keras.layers import Embedding, LSTM, Dense, Dropout, Lambda, Flatten 3 | from keras.models import Sequential 4 | import keras.backend as K 5 | from utils import tokenizer, load_embedding_matrix 6 | 7 | def get_model(embedding_dimension, essay_length): 8 | vocabulary_size = len(tokenizer.word_index) + 1 9 | embedding_matrix = load_embedding_matrix(glove_directory=GLOVE_DIR, embedding_dimension=embedding_dimension) 10 | 11 | model = Sequential() 12 | 13 | model.add(Embedding(vocabulary_size, embedding_dimension, weights=[embedding_matrix], input_length=essay_length, trainable=False, mask_zero=False)) 14 | model.add(Flatten()) 15 | model.add(Dense(128, activation='relu')) 16 | model.add(Dropout(0.5)) 17 | model.add(Dense(256, activation='relu')) 18 | model.add(Dropout(0.3)) 19 | model.add(Dense(1, activation='sigmoid')) 20 | 21 | model.compile(loss='mean_squared_error', optimizer='rmsprop', metrics=['mae']) 22 | model.summary() 23 | 24 | return model -------------------------------------------------------------------------------- /models/lstm.py: -------------------------------------------------------------------------------- 1 | from constants import GLOVE_DIR 2 | from keras.layers import Embedding, LSTM, Dense, Dropout, Lambda, Flatten 3 | from keras.models import Sequential 4 | import keras.backend as K 5 | from utils import tokenizer, load_embedding_matrix 6 | 7 | def get_model(embedding_dimension, essay_length): 8 | vocabulary_size = len(tokenizer.word_index) + 1 9 | embedding_matrix = load_embedding_matrix(glove_directory=GLOVE_DIR, embedding_dimension=embedding_dimension) 10 | 11 | model = Sequential() 12 | 13 | model.add(Embedding(vocabulary_size, embedding_dimension, weights=[embedding_matrix], input_length=essay_length, trainable=False, mask_zero=False)) 14 | model.add(LSTM(64, dropout=0.4, recurrent_dropout=0.4)) 15 | model.add(Dropout(0.5)) 16 | model.add(Lambda(lambda x: K.mean(x, axis=1, keepdims=True))) 17 | model.add(Dense(1, activation='sigmoid')) 18 | 19 | model.compile(loss='mean_squared_error', optimizer='rmsprop', metrics=['mae']) 20 | model.summary() 21 | 22 | return model -------------------------------------------------------------------------------- /models/lstm_mot.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implements LSTM with Mean over Time layer. 3 | """ 4 | 5 | from constants import GLOVE_DIR 6 | from keras.layers import Embedding, LSTM, Dense, Dropout, Conv1D, Lambda 7 | from keras.models import Sequential 8 | import keras.regularizers 9 | from utils import tokenizer, load_embedding_matrix 10 | import keras.backend as K 11 | def get_model(embedding_dimension, essay_length): 12 | """ 13 | Returns compiled model. 14 | """ 15 | vocabulary_size = len(tokenizer.word_index) + 1 16 | embedding_matrix = load_embedding_matrix(GLOVE_DIR, embedding_dimension) 17 | 18 | model = Sequential() 19 | model.add(Embedding(vocabulary_size, embedding_dimension, weights=[embedding_matrix], input_length=essay_length, trainable=False, mask_zero=False)) 20 | model.add(Conv1D(filters=50, kernel_size=5, padding='same')) 21 | model.add(LSTM(300, dropout=0.4, recurrent_dropout=0.4,return_sequences=True)) 22 | model.add(Lambda(lambda x: K.mean(x, axis=1))) 23 | model.add(Dropout(0.4)) 24 | model.add(Dense(1, activation='sigmoid', activity_regularizer=keras.regularizers.l2(0.0))) 25 | model.compile(loss='mean_squared_error', optimizer='adam') 26 | 27 | return model 28 | -------------------------------------------------------------------------------- /mysite/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/.DS_Store -------------------------------------------------------------------------------- /mysite/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/db.sqlite3 -------------------------------------------------------------------------------- /mysite/grader/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/.DS_Store -------------------------------------------------------------------------------- /mysite/grader/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/__init__.py -------------------------------------------------------------------------------- /mysite/grader/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/__pycache__/admin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/__pycache__/admin.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/__pycache__/admin.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/__pycache__/admin.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/__pycache__/apps.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/__pycache__/apps.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/__pycache__/apps.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/__pycache__/apps.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/__pycache__/forms.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/__pycache__/forms.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/__pycache__/forms.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/__pycache__/forms.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/__pycache__/models.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/__pycache__/models.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/__pycache__/models.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/__pycache__/models.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/__pycache__/views.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/__pycache__/views.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/__pycache__/views.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/__pycache__/views.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from . import models 4 | # Register your models here. 5 | admin.site.register(models.Question) 6 | admin.site.register(models.Essay) -------------------------------------------------------------------------------- /mysite/grader/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class GraderConfig(AppConfig): 5 | name = 'grader' 6 | -------------------------------------------------------------------------------- /mysite/grader/deep_learning_files/final_lstm.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/deep_learning_files/final_lstm.h5 -------------------------------------------------------------------------------- /mysite/grader/deep_learning_files/word2vec.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/deep_learning_files/word2vec.bin -------------------------------------------------------------------------------- /mysite/grader/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | from .models import Question, Essay 4 | class AnswerForm(forms.ModelForm): 5 | answer = forms.CharField(max_length=100000, widget=forms.Textarea(attrs={'rows': 5, 'placeholder': "What's on your mind?"})) 6 | 7 | class Meta: 8 | model = Essay 9 | fields = ['answer'] 10 | 11 | -------------------------------------------------------------------------------- /mysite/grader/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1 on 2018-08-12 15:35 2 | 3 | from django.db import migrations, models 4 | import django.db.models.deletion 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | initial = True 10 | 11 | dependencies = [ 12 | ] 13 | 14 | operations = [ 15 | migrations.CreateModel( 16 | name='Essay', 17 | fields=[ 18 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 19 | ('content', models.TextField(max_length=2000)), 20 | ], 21 | ), 22 | migrations.CreateModel( 23 | name='Question', 24 | fields=[ 25 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 26 | ('question_title', models.TextField(max_length=2000)), 27 | ], 28 | ), 29 | migrations.AddField( 30 | model_name='essay', 31 | name='question', 32 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='grader.Question'), 33 | ), 34 | ] 35 | -------------------------------------------------------------------------------- /mysite/grader/migrations/0002_question_essayset.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1 on 2018-08-12 15:40 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('grader', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='question', 15 | name='essaySet', 16 | field=models.IntegerField(default=0, unique=True), 17 | preserve_default=False, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /mysite/grader/migrations/0003_auto_20180812_1543.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1 on 2018-08-12 15:43 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('grader', '0002_question_essayset'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name='question', 15 | old_name='essaySet', 16 | new_name='set', 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /mysite/grader/migrations/0004_auto_20180812_1546.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1 on 2018-08-12 15:46 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('grader', '0003_auto_20180812_1543'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='question', 15 | name='max_score', 16 | field=models.IntegerField(default=0), 17 | preserve_default=False, 18 | ), 19 | migrations.AddField( 20 | model_name='question', 21 | name='min_score', 22 | field=models.IntegerField(default=0), 23 | preserve_default=False, 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /mysite/grader/migrations/0005_auto_20180812_1549.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1 on 2018-08-12 15:49 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('grader', '0004_auto_20180812_1546'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='essay', 15 | name='content', 16 | field=models.TextField(max_length=100000), 17 | ), 18 | migrations.AlterField( 19 | model_name='question', 20 | name='question_title', 21 | field=models.TextField(max_length=100000), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /mysite/grader/migrations/0006_essay_score.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1 on 2018-08-12 15:54 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('grader', '0005_auto_20180812_1549'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='essay', 15 | name='score', 16 | field=models.IntegerField(null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /mysite/grader/migrations/0007_auto_20180812_1555.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1 on 2018-08-12 15:55 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('grader', '0006_essay_score'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='essay', 15 | name='score', 16 | field=models.IntegerField(blank=True, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /mysite/grader/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__init__.py -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/0001_initial.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/0001_initial.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/0001_initial.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/0001_initial.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/0002_question_essayset.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/0002_question_essayset.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/0002_question_essayset.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/0002_question_essayset.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/0003_auto_20180812_1543.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/0003_auto_20180812_1543.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/0003_auto_20180812_1543.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/0003_auto_20180812_1543.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/0004_auto_20180812_1546.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/0004_auto_20180812_1546.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/0004_auto_20180812_1546.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/0004_auto_20180812_1546.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/0005_auto_20180812_1549.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/0005_auto_20180812_1549.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/0005_auto_20180812_1549.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/0005_auto_20180812_1549.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/0006_essay_score.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/0006_essay_score.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/0006_essay_score.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/0006_essay_score.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/0007_auto_20180812_1555.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/0007_auto_20180812_1555.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/0007_auto_20180812_1555.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/0007_auto_20180812_1555.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/migrations/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/migrations/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | class Question(models.Model): 5 | """ A model of the 8 questions. """ 6 | question_title = models.TextField(max_length=100000) 7 | set = models.IntegerField(unique=True) 8 | min_score = models.IntegerField() 9 | max_score = models.IntegerField() 10 | 11 | def __str__(self): 12 | return str(self.set) 13 | 14 | class Essay(models.Model): 15 | """ Essay to be submitted. """ 16 | question = models.ForeignKey(Question, on_delete=models.CASCADE) 17 | content = models.TextField(max_length=100000) 18 | score = models.IntegerField(null=True, blank=True) -------------------------------------------------------------------------------- /mysite/grader/static/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/static/.DS_Store -------------------------------------------------------------------------------- /mysite/grader/static/css/bootstrap-grid.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Grid v4.0.0 (https://getbootstrap.com) 3 | * Copyright 2011-2018 The Bootstrap Authors 4 | * Copyright 2011-2018 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | */@-ms-viewport{width:device-width}html{box-sizing:border-box;-ms-overflow-style:scrollbar}*,::after,::before{box-sizing:inherit}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;min-height:1px;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-1{-webkit-box-flex:0;-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-webkit-box-flex:0;-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-webkit-box-flex:0;-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-webkit-box-flex:0;-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-webkit-box-flex:0;-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-webkit-box-flex:0;-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-webkit-box-flex:0;-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-sm-1{-webkit-box-flex:0;-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-webkit-box-flex:0;-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-webkit-box-flex:0;-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-webkit-box-flex:0;-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-webkit-box-flex:0;-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-webkit-box-flex:0;-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-webkit-box-flex:0;-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-sm-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-sm-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-sm-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-sm-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-sm-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-sm-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-sm-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-sm-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-sm-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-sm-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-sm-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-sm-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-sm-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-sm-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.333333%}.offset-sm-5{margin-left:41.666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.333333%}.offset-sm-8{margin-left:66.666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.333333%}.offset-sm-11{margin-left:91.666667%}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-md-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-md-1{-webkit-box-flex:0;-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{-webkit-box-flex:0;-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{-webkit-box-flex:0;-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-webkit-box-flex:0;-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{-webkit-box-flex:0;-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-webkit-box-flex:0;-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{-webkit-box-flex:0;-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-md-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-md-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-md-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-md-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-md-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-md-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-md-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-md-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-md-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-md-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-md-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-md-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-md-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-md-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.333333%}.offset-md-2{margin-left:16.666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.333333%}.offset-md-5{margin-left:41.666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.333333%}.offset-md-8{margin-left:66.666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.333333%}.offset-md-11{margin-left:91.666667%}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-lg-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-lg-1{-webkit-box-flex:0;-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{-webkit-box-flex:0;-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{-webkit-box-flex:0;-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-webkit-box-flex:0;-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{-webkit-box-flex:0;-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-webkit-box-flex:0;-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{-webkit-box-flex:0;-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-lg-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-lg-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-lg-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-lg-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-lg-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-lg-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-lg-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-lg-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-lg-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-lg-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-lg-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-lg-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-lg-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-lg-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.333333%}.offset-lg-2{margin-left:16.666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.333333%}.offset-lg-5{margin-left:41.666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.333333%}.offset-lg-8{margin-left:66.666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.333333%}.offset-lg-11{margin-left:91.666667%}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-xl-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-xl-1{-webkit-box-flex:0;-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{-webkit-box-flex:0;-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{-webkit-box-flex:0;-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-webkit-box-flex:0;-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{-webkit-box-flex:0;-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-webkit-box-flex:0;-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{-webkit-box-flex:0;-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-xl-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-xl-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-xl-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-xl-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-xl-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-xl-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-xl-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-xl-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-xl-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-xl-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-xl-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-xl-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-xl-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-xl-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.333333%}.offset-xl-2{margin-left:16.666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.333333%}.offset-xl-5{margin-left:41.666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.333333%}.offset-xl-8{margin-left:66.666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.333333%}.offset-xl-11{margin-left:91.666667%}}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-sm-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-md-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-lg-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-xl-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-print-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}.flex-row{-webkit-box-orient:horizontal!important;-webkit-box-direction:normal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-column{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-webkit-box-orient:horizontal!important;-webkit-box-direction:normal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-sm-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-webkit-box-orient:horizontal!important;-webkit-box-direction:normal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-md-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-webkit-box-orient:horizontal!important;-webkit-box-direction:normal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-lg-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-webkit-box-orient:horizontal!important;-webkit-box-direction:normal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-xl-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}} 7 | /*# sourceMappingURL=bootstrap-grid.min.css.map */ -------------------------------------------------------------------------------- /mysite/grader/static/css/bootstrap-reboot.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.0.0 (https://getbootstrap.com) 3 | * Copyright 2011-2018 The Bootstrap Authors 4 | * Copyright 2011-2018 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */ 8 | *, 9 | *::before, 10 | *::after { 11 | box-sizing: border-box; 12 | } 13 | 14 | html { 15 | font-family: sans-serif; 16 | line-height: 1.15; 17 | -webkit-text-size-adjust: 100%; 18 | -ms-text-size-adjust: 100%; 19 | -ms-overflow-style: scrollbar; 20 | -webkit-tap-highlight-color: transparent; 21 | } 22 | 23 | @-ms-viewport { 24 | width: device-width; 25 | } 26 | 27 | article, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section { 28 | display: block; 29 | } 30 | 31 | body { 32 | margin: 0; 33 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; 34 | font-size: 1rem; 35 | font-weight: 400; 36 | line-height: 1.5; 37 | color: #212529; 38 | text-align: left; 39 | background-color: #fff; 40 | } 41 | 42 | [tabindex="-1"]:focus { 43 | outline: 0 !important; 44 | } 45 | 46 | hr { 47 | box-sizing: content-box; 48 | height: 0; 49 | overflow: visible; 50 | } 51 | 52 | h1, h2, h3, h4, h5, h6 { 53 | margin-top: 0; 54 | margin-bottom: 0.5rem; 55 | } 56 | 57 | p { 58 | margin-top: 0; 59 | margin-bottom: 1rem; 60 | } 61 | 62 | abbr[title], 63 | abbr[data-original-title] { 64 | text-decoration: underline; 65 | -webkit-text-decoration: underline dotted; 66 | text-decoration: underline dotted; 67 | cursor: help; 68 | border-bottom: 0; 69 | } 70 | 71 | address { 72 | margin-bottom: 1rem; 73 | font-style: normal; 74 | line-height: inherit; 75 | } 76 | 77 | ol, 78 | ul, 79 | dl { 80 | margin-top: 0; 81 | margin-bottom: 1rem; 82 | } 83 | 84 | ol ol, 85 | ul ul, 86 | ol ul, 87 | ul ol { 88 | margin-bottom: 0; 89 | } 90 | 91 | dt { 92 | font-weight: 700; 93 | } 94 | 95 | dd { 96 | margin-bottom: .5rem; 97 | margin-left: 0; 98 | } 99 | 100 | blockquote { 101 | margin: 0 0 1rem; 102 | } 103 | 104 | dfn { 105 | font-style: italic; 106 | } 107 | 108 | b, 109 | strong { 110 | font-weight: bolder; 111 | } 112 | 113 | small { 114 | font-size: 80%; 115 | } 116 | 117 | sub, 118 | sup { 119 | position: relative; 120 | font-size: 75%; 121 | line-height: 0; 122 | vertical-align: baseline; 123 | } 124 | 125 | sub { 126 | bottom: -.25em; 127 | } 128 | 129 | sup { 130 | top: -.5em; 131 | } 132 | 133 | a { 134 | color: #007bff; 135 | text-decoration: none; 136 | background-color: transparent; 137 | -webkit-text-decoration-skip: objects; 138 | } 139 | 140 | a:hover { 141 | color: #0056b3; 142 | text-decoration: underline; 143 | } 144 | 145 | a:not([href]):not([tabindex]) { 146 | color: inherit; 147 | text-decoration: none; 148 | } 149 | 150 | a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus { 151 | color: inherit; 152 | text-decoration: none; 153 | } 154 | 155 | a:not([href]):not([tabindex]):focus { 156 | outline: 0; 157 | } 158 | 159 | pre, 160 | code, 161 | kbd, 162 | samp { 163 | font-family: monospace, monospace; 164 | font-size: 1em; 165 | } 166 | 167 | pre { 168 | margin-top: 0; 169 | margin-bottom: 1rem; 170 | overflow: auto; 171 | -ms-overflow-style: scrollbar; 172 | } 173 | 174 | figure { 175 | margin: 0 0 1rem; 176 | } 177 | 178 | img { 179 | vertical-align: middle; 180 | border-style: none; 181 | } 182 | 183 | svg:not(:root) { 184 | overflow: hidden; 185 | } 186 | 187 | table { 188 | border-collapse: collapse; 189 | } 190 | 191 | caption { 192 | padding-top: 0.75rem; 193 | padding-bottom: 0.75rem; 194 | color: #6c757d; 195 | text-align: left; 196 | caption-side: bottom; 197 | } 198 | 199 | th { 200 | text-align: inherit; 201 | } 202 | 203 | label { 204 | display: inline-block; 205 | margin-bottom: .5rem; 206 | } 207 | 208 | button { 209 | border-radius: 0; 210 | } 211 | 212 | button:focus { 213 | outline: 1px dotted; 214 | outline: 5px auto -webkit-focus-ring-color; 215 | } 216 | 217 | input, 218 | button, 219 | select, 220 | optgroup, 221 | textarea { 222 | margin: 0; 223 | font-family: inherit; 224 | font-size: inherit; 225 | line-height: inherit; 226 | } 227 | 228 | button, 229 | input { 230 | overflow: visible; 231 | } 232 | 233 | button, 234 | select { 235 | text-transform: none; 236 | } 237 | 238 | button, 239 | html [type="button"], 240 | [type="reset"], 241 | [type="submit"] { 242 | -webkit-appearance: button; 243 | } 244 | 245 | button::-moz-focus-inner, 246 | [type="button"]::-moz-focus-inner, 247 | [type="reset"]::-moz-focus-inner, 248 | [type="submit"]::-moz-focus-inner { 249 | padding: 0; 250 | border-style: none; 251 | } 252 | 253 | input[type="radio"], 254 | input[type="checkbox"] { 255 | box-sizing: border-box; 256 | padding: 0; 257 | } 258 | 259 | input[type="date"], 260 | input[type="time"], 261 | input[type="datetime-local"], 262 | input[type="month"] { 263 | -webkit-appearance: listbox; 264 | } 265 | 266 | textarea { 267 | overflow: auto; 268 | resize: vertical; 269 | } 270 | 271 | fieldset { 272 | min-width: 0; 273 | padding: 0; 274 | margin: 0; 275 | border: 0; 276 | } 277 | 278 | legend { 279 | display: block; 280 | width: 100%; 281 | max-width: 100%; 282 | padding: 0; 283 | margin-bottom: .5rem; 284 | font-size: 1.5rem; 285 | line-height: inherit; 286 | color: inherit; 287 | white-space: normal; 288 | } 289 | 290 | progress { 291 | vertical-align: baseline; 292 | } 293 | 294 | [type="number"]::-webkit-inner-spin-button, 295 | [type="number"]::-webkit-outer-spin-button { 296 | height: auto; 297 | } 298 | 299 | [type="search"] { 300 | outline-offset: -2px; 301 | -webkit-appearance: none; 302 | } 303 | 304 | [type="search"]::-webkit-search-cancel-button, 305 | [type="search"]::-webkit-search-decoration { 306 | -webkit-appearance: none; 307 | } 308 | 309 | ::-webkit-file-upload-button { 310 | font: inherit; 311 | -webkit-appearance: button; 312 | } 313 | 314 | output { 315 | display: inline-block; 316 | } 317 | 318 | summary { 319 | display: list-item; 320 | cursor: pointer; 321 | } 322 | 323 | template { 324 | display: none; 325 | } 326 | 327 | [hidden] { 328 | display: none !important; 329 | } 330 | /*# sourceMappingURL=bootstrap-reboot.css.map */ -------------------------------------------------------------------------------- /mysite/grader/static/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.0.0 (https://getbootstrap.com) 3 | * Copyright 2011-2018 The Bootstrap Authors 4 | * Copyright 2011-2018 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /mysite/grader/static/css/bootstrap-reboot.min.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../../scss/bootstrap-reboot.scss","../../scss/_reboot.scss","dist/css/bootstrap-reboot.css","bootstrap-reboot.css","../../scss/mixins/_hover.scss"],"names":[],"mappings":"AAAA;;;;;;ACoBA,ECXA,QADA,SDeE,WAAA,WAGF,KACE,YAAA,WACA,YAAA,KACA,yBAAA,KACA,qBAAA,KACA,mBAAA,UACA,4BAAA,YAKA,cACE,MAAA,aAMJ,QAAA,MAAA,OAAA,WAAA,OAAA,OAAA,OAAA,OAAA,KAAA,IAAA,QACE,QAAA,MAWF,KACE,OAAA,EACA,YAAA,aAAA,CAAA,kBAAA,CAAA,UAAA,CAAA,MAAA,CAAA,gBAAA,CAAA,KAAA,CAAA,UAAA,CAAA,mBAAA,CAAA,gBAAA,CAAA,kBACA,UAAA,KACA,YAAA,IACA,YAAA,IACA,MAAA,QACA,WAAA,KACA,iBAAA,KEvBF,sBFgCE,QAAA,YASF,GACE,WAAA,YACA,OAAA,EACA,SAAA,QAaF,GAAA,GAAA,GAAA,GAAA,GAAA,GACE,WAAA,EACA,cAAA,MAQF,EACE,WAAA,EACA,cAAA,KChDF,0BD0DA,YAEE,gBAAA,UACA,wBAAA,UAAA,OAAA,gBAAA,UAAA,OACA,OAAA,KACA,cAAA,EAGF,QACE,cAAA,KACA,WAAA,OACA,YAAA,QCrDF,GDwDA,GCzDA,GD4DE,WAAA,EACA,cAAA,KAGF,MCxDA,MACA,MAFA,MD6DE,cAAA,EAGF,GACE,YAAA,IAGF,GACE,cAAA,MACA,YAAA,EAGF,WACE,OAAA,EAAA,EAAA,KAGF,IACE,WAAA,OAIF,EC1DA,OD4DE,YAAA,OAIF,MACE,UAAA,IAQF,IChEA,IDkEE,SAAA,SACA,UAAA,IACA,YAAA,EACA,eAAA,SAGF,IAAM,OAAA,OACN,IAAM,IAAA,MAON,EACE,MAAA,QACA,gBAAA,KACA,iBAAA,YACA,6BAAA,QG3LA,QH8LE,MAAA,QACA,gBAAA,UAUJ,8BACE,MAAA,QACA,gBAAA,KGvMA,oCAAA,oCH0ME,MAAA,QACA,gBAAA,KANJ,oCAUI,QAAA,EClEJ,KACA,ID2EA,IC1EA,KD8EE,YAAA,SAAA,CAAA,UACA,UAAA,IAIF,IAEE,WAAA,EAEA,cAAA,KAEA,SAAA,KAGA,mBAAA,UAQF,OAEE,OAAA,EAAA,EAAA,KAQF,IACE,eAAA,OACA,aAAA,KAGF,eACE,SAAA,OAQF,MACE,gBAAA,SAGF,QACE,YAAA,OACA,eAAA,OACA,MAAA,QACA,WAAA,KACA,aAAA,OAGF,GAGE,WAAA,QAQF,MAEE,QAAA,aACA,cAAA,MAMF,OACE,cAAA,EAOF,aACE,QAAA,IAAA,OACA,QAAA,IAAA,KAAA,yBC9GF,ODiHA,MC/GA,SADA,OAEA,SDmHE,OAAA,EACA,YAAA,QACA,UAAA,QACA,YAAA,QAGF,OCjHA,MDmHE,SAAA,QAGF,OCjHA,ODmHE,eAAA,KC7GF,aACA,cDkHA,OCpHA,mBDwHE,mBAAA,OCjHF,gCACA,+BACA,gCDmHA,yBAIE,QAAA,EACA,aAAA,KClHF,qBDqHA,kBAEE,WAAA,WACA,QAAA,EAIF,iBCrHA,2BACA,kBAFA,iBD+HE,mBAAA,QAGF,SACE,SAAA,KAEA,OAAA,SAGF,SAME,UAAA,EAEA,QAAA,EACA,OAAA,EACA,OAAA,EAKF,OACE,QAAA,MACA,MAAA,KACA,UAAA,KACA,QAAA,EACA,cAAA,MACA,UAAA,OACA,YAAA,QACA,MAAA,QACA,YAAA,OAGF,SACE,eAAA,SEnIF,yCDEA,yCDuIE,OAAA,KEpIF,cF4IE,eAAA,KACA,mBAAA,KExIF,4CDEA,yCD+IE,mBAAA,KAQF,6BACE,KAAA,QACA,mBAAA,OAOF,OACE,QAAA,aAGF,QACE,QAAA,UACA,OAAA,QAGF,SACE,QAAA,KErJF,SF2JE,QAAA","sourcesContent":["/*!\n * Bootstrap Reboot v4.0.0 (https://getbootstrap.com)\n * Copyright 2011-2018 The Bootstrap Authors\n * Copyright 2011-2018 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)\n */\n\n@import \"functions\";\n@import \"variables\";\n@import \"mixins\";\n@import \"reboot\";\n","// stylelint-disable at-rule-no-vendor-prefix, declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix\n\n// Reboot\n//\n// Normalization of HTML elements, manually forked from Normalize.css to remove\n// styles targeting irrelevant browsers while applying new styles.\n//\n// Normalize is licensed MIT. https://github.com/necolas/normalize.css\n\n\n// Document\n//\n// 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.\n// 2. Change the default font family in all browsers.\n// 3. Correct the line height in all browsers.\n// 4. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS.\n// 5. Setting @viewport causes scrollbars to overlap content in IE11 and Edge, so\n// we force a non-overlapping, non-auto-hiding scrollbar to counteract.\n// 6. Change the default tap highlight to be completely transparent in iOS.\n\n*,\n*::before,\n*::after {\n box-sizing: border-box; // 1\n}\n\nhtml {\n font-family: sans-serif; // 2\n line-height: 1.15; // 3\n -webkit-text-size-adjust: 100%; // 4\n -ms-text-size-adjust: 100%; // 4\n -ms-overflow-style: scrollbar; // 5\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0); // 6\n}\n\n// IE10+ doesn't honor `` in some cases.\n@at-root {\n @-ms-viewport {\n width: device-width;\n }\n}\n\n// stylelint-disable selector-list-comma-newline-after\n// Shim for \"new\" HTML5 structural elements to display correctly (IE10, older browsers)\narticle, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n// stylelint-enable selector-list-comma-newline-after\n\n// Body\n//\n// 1. Remove the margin in all browsers.\n// 2. As a best practice, apply a default `background-color`.\n// 3. Set an explicit initial text-align value so that we can later use the\n// the `inherit` value on things like `` elements.\n\nbody {\n margin: 0; // 1\n font-family: $font-family-base;\n font-size: $font-size-base;\n font-weight: $font-weight-base;\n line-height: $line-height-base;\n color: $body-color;\n text-align: left; // 3\n background-color: $body-bg; // 2\n}\n\n// Suppress the focus outline on elements that cannot be accessed via keyboard.\n// This prevents an unwanted focus outline from appearing around elements that\n// might still respond to pointer events.\n//\n// Credit: https://github.com/suitcss/base\n[tabindex=\"-1\"]:focus {\n outline: 0 !important;\n}\n\n\n// Content grouping\n//\n// 1. Add the correct box sizing in Firefox.\n// 2. Show the overflow in Edge and IE.\n\nhr {\n box-sizing: content-box; // 1\n height: 0; // 1\n overflow: visible; // 2\n}\n\n\n//\n// Typography\n//\n\n// Remove top margins from headings\n//\n// By default, `

`-`

` all receive top and bottom margins. We nuke the top\n// margin for easier control within type scales as it avoids margin collapsing.\n// stylelint-disable selector-list-comma-newline-after\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: $headings-margin-bottom;\n}\n// stylelint-enable selector-list-comma-newline-after\n\n// Reset margins on paragraphs\n//\n// Similarly, the top margin on `

`s get reset. However, we also reset the\n// bottom margin to use `rem` units instead of `em`.\np {\n margin-top: 0;\n margin-bottom: $paragraph-margin-bottom;\n}\n\n// Abbreviations\n//\n// 1. Remove the bottom border in Firefox 39-.\n// 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n// 3. Add explicit cursor to indicate changed behavior.\n// 4. Duplicate behavior to the data-* attribute for our tooltip plugin\n\nabbr[title],\nabbr[data-original-title] { // 4\n text-decoration: underline; // 2\n text-decoration: underline dotted; // 2\n cursor: help; // 3\n border-bottom: 0; // 1\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: $dt-font-weight;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0; // Undo browser default\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic; // Add the correct font style in Android 4.3-\n}\n\n// stylelint-disable font-weight-notation\nb,\nstrong {\n font-weight: bolder; // Add the correct font weight in Chrome, Edge, and Safari\n}\n// stylelint-enable font-weight-notation\n\nsmall {\n font-size: 80%; // Add the correct font size in all browsers\n}\n\n//\n// Prevent `sub` and `sup` elements from affecting the line height in\n// all browsers.\n//\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub { bottom: -.25em; }\nsup { top: -.5em; }\n\n\n//\n// Links\n//\n\na {\n color: $link-color;\n text-decoration: $link-decoration;\n background-color: transparent; // Remove the gray background on active links in IE 10.\n -webkit-text-decoration-skip: objects; // Remove gaps in links underline in iOS 8+ and Safari 8+.\n\n @include hover {\n color: $link-hover-color;\n text-decoration: $link-hover-decoration;\n }\n}\n\n// And undo these styles for placeholder links/named anchors (without href)\n// which have not been made explicitly keyboard-focusable (without tabindex).\n// It would be more straightforward to just use a[href] in previous block, but that\n// causes specificity issues in many other styles that are too complex to fix.\n// See https://github.com/twbs/bootstrap/issues/19402\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n\n @include hover-focus {\n color: inherit;\n text-decoration: none;\n }\n\n &:focus {\n outline: 0;\n }\n}\n\n\n//\n// Code\n//\n\n// stylelint-disable font-family-no-duplicate-names\npre,\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; // Correct the inheritance and scaling of font size in all browsers.\n font-size: 1em; // Correct the odd `em` font sizing in all browsers.\n}\n// stylelint-enable font-family-no-duplicate-names\n\npre {\n // Remove browser default top margin\n margin-top: 0;\n // Reset browser default of `1em` to use `rem`s\n margin-bottom: 1rem;\n // Don't allow content to break outside\n overflow: auto;\n // We have @viewport set which causes scrollbars to overlap content in IE11 and Edge, so\n // we force a non-overlapping, non-auto-hiding scrollbar to counteract.\n -ms-overflow-style: scrollbar;\n}\n\n\n//\n// Figures\n//\n\nfigure {\n // Apply a consistent margin strategy (matches our type styles).\n margin: 0 0 1rem;\n}\n\n\n//\n// Images and content\n//\n\nimg {\n vertical-align: middle;\n border-style: none; // Remove the border on images inside links in IE 10-.\n}\n\nsvg:not(:root) {\n overflow: hidden; // Hide the overflow in IE\n}\n\n\n//\n// Tables\n//\n\ntable {\n border-collapse: collapse; // Prevent double borders\n}\n\ncaption {\n padding-top: $table-cell-padding;\n padding-bottom: $table-cell-padding;\n color: $text-muted;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n // Matches default `` alignment by inheriting from the ``, or the\n // closest parent with a set `text-align`.\n text-align: inherit;\n}\n\n\n//\n// Forms\n//\n\nlabel {\n // Allow labels to use `margin` for spacing.\n display: inline-block;\n margin-bottom: .5rem;\n}\n\n// Remove the default `border-radius` that macOS Chrome adds.\n//\n// Details at https://github.com/twbs/bootstrap/issues/24093\nbutton {\n border-radius: 0;\n}\n\n// Work around a Firefox/IE bug where the transparent `button` background\n// results in a loss of the default `button` focus styles.\n//\n// Credit: https://github.com/suitcss/base/\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0; // Remove the margin in Firefox and Safari\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible; // Show the overflow in Edge\n}\n\nbutton,\nselect {\n text-transform: none; // Remove the inheritance of text transform in Firefox\n}\n\n// 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`\n// controls in Android 4.\n// 2. Correct the inability to style clickable types in iOS and Safari.\nbutton,\nhtml [type=\"button\"], // 1\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button; // 2\n}\n\n// Remove inner border and padding from Firefox, but don't restore the outline like Normalize.\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box; // 1. Add the correct box sizing in IE 10-\n padding: 0; // 2. Remove the padding in IE 10-\n}\n\n\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n // Remove the default appearance of temporal inputs to avoid a Mobile Safari\n // bug where setting a custom line-height prevents text from being vertically\n // centered within the input.\n // See https://bugs.webkit.org/show_bug.cgi?id=139848\n // and https://github.com/twbs/bootstrap/issues/11266\n -webkit-appearance: listbox;\n}\n\ntextarea {\n overflow: auto; // Remove the default vertical scrollbar in IE.\n // Textareas should really only resize vertically so they don't break their (horizontal) containers.\n resize: vertical;\n}\n\nfieldset {\n // Browsers set a default `min-width: min-content;` on fieldsets,\n // unlike e.g. `

`s, which have `min-width: 0;` by default.\n // So we reset that to ensure fieldsets behave more like a standard block element.\n // See https://github.com/twbs/bootstrap/issues/12359\n // and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements\n min-width: 0;\n // Reset the default outline behavior of fieldsets so they don't affect page layout.\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n// 1. Correct the text wrapping in Edge and IE.\n// 2. Correct the color inheritance from `fieldset` elements in IE.\nlegend {\n display: block;\n width: 100%;\n max-width: 100%; // 1\n padding: 0;\n margin-bottom: .5rem;\n font-size: 1.5rem;\n line-height: inherit;\n color: inherit; // 2\n white-space: normal; // 1\n}\n\nprogress {\n vertical-align: baseline; // Add the correct vertical alignment in Chrome, Firefox, and Opera.\n}\n\n// Correct the cursor style of increment and decrement buttons in Chrome.\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n // This overrides the extra rounded corners on search inputs in iOS so that our\n // `.form-control` class can properly style them. Note that this cannot simply\n // be added to `.form-control` as it's not specific enough. For details, see\n // https://github.com/twbs/bootstrap/issues/11586.\n outline-offset: -2px; // 2. Correct the outline style in Safari.\n -webkit-appearance: none;\n}\n\n//\n// Remove the inner padding and cancel buttons in Chrome and Safari on macOS.\n//\n\n[type=\"search\"]::-webkit-search-cancel-button,\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n//\n// 1. Correct the inability to style clickable types in iOS and Safari.\n// 2. Change font properties to `inherit` in Safari.\n//\n\n::-webkit-file-upload-button {\n font: inherit; // 2\n -webkit-appearance: button; // 1\n}\n\n//\n// Correct element displays\n//\n\noutput {\n display: inline-block;\n}\n\nsummary {\n display: list-item; // Add the correct display in all browsers\n cursor: pointer;\n}\n\ntemplate {\n display: none; // Add the correct display in IE\n}\n\n// Always hide an element with the `hidden` HTML attribute (from PureCSS).\n// Needed for proper display in IE 10-.\n[hidden] {\n display: none !important;\n}\n","/*!\n * Bootstrap Reboot v4.0.0 (https://getbootstrap.com)\n * Copyright 2011-2018 The Bootstrap Authors\n * Copyright 2011-2018 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)\n */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\nhtml {\n font-family: sans-serif;\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n -ms-overflow-style: scrollbar;\n -webkit-tap-highlight-color: transparent;\n}\n\n@-ms-viewport {\n width: device-width;\n}\n\narticle, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #212529;\n text-align: left;\n background-color: #fff;\n}\n\n[tabindex=\"-1\"]:focus {\n outline: 0 !important;\n}\n\nhr {\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n}\n\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: 0.5rem;\n}\n\np {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nabbr[title],\nabbr[data-original-title] {\n text-decoration: underline;\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n cursor: help;\n border-bottom: 0;\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: 700;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0;\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic;\n}\n\nb,\nstrong {\n font-weight: bolder;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -.25em;\n}\n\nsup {\n top: -.5em;\n}\n\na {\n color: #007bff;\n text-decoration: none;\n background-color: transparent;\n -webkit-text-decoration-skip: objects;\n}\n\na:hover {\n color: #0056b3;\n text-decoration: underline;\n}\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n}\n\na:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus {\n color: inherit;\n text-decoration: none;\n}\n\na:not([href]):not([tabindex]):focus {\n outline: 0;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\npre {\n margin-top: 0;\n margin-bottom: 1rem;\n overflow: auto;\n -ms-overflow-style: scrollbar;\n}\n\nfigure {\n margin: 0 0 1rem;\n}\n\nimg {\n vertical-align: middle;\n border-style: none;\n}\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\ntable {\n border-collapse: collapse;\n}\n\ncaption {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n color: #6c757d;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n text-align: inherit;\n}\n\nlabel {\n display: inline-block;\n margin-bottom: .5rem;\n}\n\nbutton {\n border-radius: 0;\n}\n\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\nhtml [type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box;\n padding: 0;\n}\n\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n -webkit-appearance: listbox;\n}\n\ntextarea {\n overflow: auto;\n resize: vertical;\n}\n\nfieldset {\n min-width: 0;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\nlegend {\n display: block;\n width: 100%;\n max-width: 100%;\n padding: 0;\n margin-bottom: .5rem;\n font-size: 1.5rem;\n line-height: inherit;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n vertical-align: baseline;\n}\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n outline-offset: -2px;\n -webkit-appearance: none;\n}\n\n[type=\"search\"]::-webkit-search-cancel-button,\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n::-webkit-file-upload-button {\n font: inherit;\n -webkit-appearance: button;\n}\n\noutput {\n display: inline-block;\n}\n\nsummary {\n display: list-item;\n cursor: pointer;\n}\n\ntemplate {\n display: none;\n}\n\n[hidden] {\n display: none !important;\n}\n/*# sourceMappingURL=bootstrap-reboot.css.map */","/*!\n * Bootstrap Reboot v4.0.0 (https://getbootstrap.com)\n * Copyright 2011-2018 The Bootstrap Authors\n * Copyright 2011-2018 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)\n */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\nhtml {\n font-family: sans-serif;\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n -ms-overflow-style: scrollbar;\n -webkit-tap-highlight-color: transparent;\n}\n\n@-ms-viewport {\n width: device-width;\n}\n\narticle, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #212529;\n text-align: left;\n background-color: #fff;\n}\n\n[tabindex=\"-1\"]:focus {\n outline: 0 !important;\n}\n\nhr {\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n}\n\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: 0.5rem;\n}\n\np {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nabbr[title],\nabbr[data-original-title] {\n text-decoration: underline;\n text-decoration: underline dotted;\n cursor: help;\n border-bottom: 0;\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: 700;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0;\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic;\n}\n\nb,\nstrong {\n font-weight: bolder;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -.25em;\n}\n\nsup {\n top: -.5em;\n}\n\na {\n color: #007bff;\n text-decoration: none;\n background-color: transparent;\n -webkit-text-decoration-skip: objects;\n}\n\na:hover {\n color: #0056b3;\n text-decoration: underline;\n}\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n}\n\na:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus {\n color: inherit;\n text-decoration: none;\n}\n\na:not([href]):not([tabindex]):focus {\n outline: 0;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\npre {\n margin-top: 0;\n margin-bottom: 1rem;\n overflow: auto;\n -ms-overflow-style: scrollbar;\n}\n\nfigure {\n margin: 0 0 1rem;\n}\n\nimg {\n vertical-align: middle;\n border-style: none;\n}\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\ntable {\n border-collapse: collapse;\n}\n\ncaption {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n color: #6c757d;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n text-align: inherit;\n}\n\nlabel {\n display: inline-block;\n margin-bottom: .5rem;\n}\n\nbutton {\n border-radius: 0;\n}\n\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\nhtml [type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box;\n padding: 0;\n}\n\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n -webkit-appearance: listbox;\n}\n\ntextarea {\n overflow: auto;\n resize: vertical;\n}\n\nfieldset {\n min-width: 0;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\nlegend {\n display: block;\n width: 100%;\n max-width: 100%;\n padding: 0;\n margin-bottom: .5rem;\n font-size: 1.5rem;\n line-height: inherit;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n vertical-align: baseline;\n}\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n outline-offset: -2px;\n -webkit-appearance: none;\n}\n\n[type=\"search\"]::-webkit-search-cancel-button,\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n::-webkit-file-upload-button {\n font: inherit;\n -webkit-appearance: button;\n}\n\noutput {\n display: inline-block;\n}\n\nsummary {\n display: list-item;\n cursor: pointer;\n}\n\ntemplate {\n display: none;\n}\n\n[hidden] {\n display: none !important;\n}\n\n/*# sourceMappingURL=bootstrap-reboot.css.map */","// stylelint-disable indentation\n\n// Hover mixin and `$enable-hover-media-query` are deprecated.\n//\n// Origally added during our alphas and maintained during betas, this mixin was\n// designed to prevent `:hover` stickiness on iOS—an issue where hover styles\n// would persist after initial touch.\n//\n// For backward compatibility, we've kept these mixins and updated them to\n// always return their regular psuedo-classes instead of a shimmed media query.\n//\n// Issue: https://github.com/twbs/bootstrap/issues/25195\n\n@mixin hover {\n &:hover { @content; }\n}\n\n@mixin hover-focus {\n &:hover,\n &:focus {\n @content;\n }\n}\n\n@mixin plain-hover-focus {\n &,\n &:hover,\n &:focus {\n @content;\n }\n}\n\n@mixin hover-focus-active {\n &:hover,\n &:focus,\n &:active {\n @content;\n }\n}\n"]} -------------------------------------------------------------------------------- /mysite/grader/templates/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/templates/.DS_Store -------------------------------------------------------------------------------- /mysite/grader/templates/grader/essay.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load widget_tweaks %} 3 | {% block breadcrumb %} 4 | 5 | 6 | 7 | {% endblock %} 8 | {% block content %} 9 |
10 |

Grade {{ essay.score }}

11 |

Congratulations! Maximum Possible Score on this question is {{ essay.question.max_score }}

12 |
13 |

Your essay is graded by the magical power of neural networks.

14 | Learn more 15 |
16 | 17 |
18 |

Your Submission

19 |

{{ essay.content }}

20 |
21 | {% endblock %} -------------------------------------------------------------------------------- /mysite/grader/templates/grader/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block breadcrumb %} 3 | 4 | {% endblock %} 5 | {% block content %} 6 | {% if questions_list %} 7 |

Alright! Let's select a Question Set to start writing!

8 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | {% for question in questions_list %} 23 | 24 | 25 | 26 | 27 | 28 | 29 | {% endfor %} 30 | 31 | 32 |
#QuestionMin ScoreMax Score
{{ question.set }}{{ question.question_title|truncatewords:15 }}{{ question.min_score }}{{ question.max_score }}
33 | 34 | 40 | 41 | 42 | 43 | 50 | {% else %} 51 |

No polls are available.

52 | {% endif %} 53 | {% endblock %} 54 | 55 | -------------------------------------------------------------------------------- /mysite/grader/templates/grader/question.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load widget_tweaks %} 3 | {% block breadcrumb %} 4 | 5 | 6 | {% endblock %} 7 | {% block content %} 8 | {% if question %} 9 |

Question Set {{ question.set }}

10 |

{{ question.question_title }}

11 | 12 |
13 | {% csrf_token %} 14 | {% include 'includes/form.html' %} 15 | 16 |
17 | 18 | {% else %} 19 |

Error

20 | {% endif %} 21 | {% endblock %} -------------------------------------------------------------------------------- /mysite/grader/templates/includes/form.html: -------------------------------------------------------------------------------- 1 | {% load widget_tweaks %} 2 | 3 | {% for field in form %} 4 |
5 | {{ field.label_tag }} 6 | 7 | {% if form.is_bound %} 8 | {% if field.errors %} 9 | {% render_field field class="form-control is-invalid" %} 10 | {% for error in field.errors %} 11 |
12 | {{ error }} 13 |
14 | {% endfor %} 15 | {% else %} 16 | {% render_field field class="form-control is-valid" %} 17 | {% endif %} 18 | {% else %} 19 | {% render_field field class="form-control" %} 20 | {% endif %} 21 | 22 | {% if field.help_text %} 23 | 24 | {{ field.help_text }} 25 | 26 | {% endif %} 27 |
28 | {% endfor %} 29 | -------------------------------------------------------------------------------- /mysite/grader/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /mysite/grader/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from django.conf.urls import url 3 | 4 | from . import views 5 | 6 | urlpatterns = [ 7 | path('', views.index, name='index'), 8 | path('/', views.question, name='question'), 9 | path('/essay/', views.essay, name='essay'), 10 | ] -------------------------------------------------------------------------------- /mysite/grader/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/utils/__init__.py -------------------------------------------------------------------------------- /mysite/grader/utils/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/utils/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/utils/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/utils/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/utils/__pycache__/helpers.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/utils/__pycache__/helpers.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/utils/__pycache__/helpers.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/utils/__pycache__/helpers.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/utils/__pycache__/model.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/utils/__pycache__/model.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/grader/utils/__pycache__/model.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/grader/utils/__pycache__/model.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/grader/utils/helpers.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import nltk 3 | import re 4 | from nltk.corpus import stopwords 5 | from gensim.models import Word2Vec 6 | import gensim.models.keyedvectors as word2vec 7 | import math 8 | 9 | def essay_to_wordlist(essay_v, remove_stopwords): 10 | """Remove the tagged labels and word tokenize the sentence.""" 11 | essay_v = re.sub("[^a-zA-Z]", " ", essay_v) 12 | words = essay_v.lower().split() 13 | if remove_stopwords: 14 | stops = set(stopwords.words("english")) 15 | words = [w for w in words if not w in stops] 16 | return (words) 17 | 18 | def essay_to_sentences(essay_v, remove_stopwords): 19 | """Sentence tokenize the essay and call essay_to_wordlist() for word tokenization.""" 20 | tokenizer = nltk.data.load('tokenizers/punkt/english.pickle') 21 | raw_sentences = tokenizer.tokenize(essay_v.strip()) 22 | sentences = [] 23 | for raw_sentence in raw_sentences: 24 | if len(raw_sentence) > 0: 25 | sentences.append(essay_to_wordlist(raw_sentence, remove_stopwords)) 26 | return sentences 27 | 28 | def makeFeatureVec(words, model, num_features): 29 | """Make Feature Vector from the words list of an Essay.""" 30 | featureVec = np.zeros((num_features,),dtype="float32") 31 | num_words = 0. 32 | index2word_set = set(model.wv.index2word) 33 | for word in words: 34 | if word in index2word_set: 35 | num_words += 1 36 | featureVec = np.add(featureVec,model[word]) 37 | featureVec = np.divide(featureVec,num_words) 38 | return featureVec 39 | 40 | def getAvgFeatureVecs(essays, model, num_features): 41 | """Main function to generate the word vectors for word2vec model.""" 42 | counter = 0 43 | essayFeatureVecs = np.zeros((len(essays),num_features),dtype="float32") 44 | for essay in essays: 45 | essayFeatureVecs[counter] = makeFeatureVec(essay, model, num_features) 46 | counter = counter + 1 47 | return essayFeatureVecs -------------------------------------------------------------------------------- /mysite/grader/utils/model.py: -------------------------------------------------------------------------------- 1 | from keras.layers import Embedding, LSTM, Dense, Dropout, Lambda, Flatten 2 | from keras.models import Sequential, load_model, model_from_config 3 | import keras.backend as K 4 | 5 | def get_model(): 6 | """Define the model.""" 7 | model = Sequential() 8 | model.add(LSTM(300, dropout=0.4, recurrent_dropout=0.4, input_shape=[1, 300], return_sequences=True)) 9 | model.add(LSTM(64, recurrent_dropout=0.4)) 10 | model.add(Dropout(0.5)) 11 | model.add(Dense(1, activation='relu')) 12 | 13 | model.compile(loss='mean_squared_error', optimizer='rmsprop', metrics=['mae']) 14 | model.summary() 15 | 16 | return model -------------------------------------------------------------------------------- /mysite/grader/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import get_object_or_404, render, redirect 2 | from django.http import HttpResponseRedirect, HttpResponse 3 | from django.urls import reverse 4 | 5 | from .models import Question, Essay 6 | from .forms import AnswerForm 7 | 8 | from .utils.model import * 9 | from .utils.helpers import * 10 | 11 | import os 12 | current_path = os.path.abspath(os.path.dirname(__file__)) 13 | 14 | # Create your views here. 15 | def index(request): 16 | questions_list = Question.objects.order_by('set') 17 | context = { 18 | 'questions_list': questions_list, 19 | } 20 | return render(request, 'grader/index.html', context) 21 | 22 | def essay(request, question_id, essay_id): 23 | essay = get_object_or_404(Essay, pk=essay_id) 24 | context = { 25 | "essay": essay, 26 | } 27 | return render(request, 'grader/essay.html', context) 28 | 29 | def question(request, question_id): 30 | question = get_object_or_404(Question, pk=question_id) 31 | if request.method == 'POST': 32 | # create a form instance and populate it with data from the request: 33 | form = AnswerForm(request.POST) 34 | if form.is_valid(): 35 | 36 | content = form.cleaned_data.get('answer') 37 | 38 | if len(content) > 20: 39 | num_features = 300 40 | model = word2vec.KeyedVectors.load_word2vec_format(os.path.join(current_path, "deep_learning_files/word2vec.bin"), binary=True) 41 | clean_test_essays = [] 42 | clean_test_essays.append(essay_to_wordlist( content, remove_stopwords=True )) 43 | testDataVecs = getAvgFeatureVecs( clean_test_essays, model, num_features ) 44 | testDataVecs = np.array(testDataVecs) 45 | testDataVecs = np.reshape(testDataVecs, (testDataVecs.shape[0], 1, testDataVecs.shape[1])) 46 | 47 | lstm_model = get_model() 48 | lstm_model.load_weights(os.path.join(current_path, "deep_learning_files/final_lstm.h5")) 49 | preds = lstm_model.predict(testDataVecs) 50 | 51 | if math.isnan(preds): 52 | preds = 0 53 | else: 54 | preds = np.around(preds) 55 | 56 | if preds < 0: 57 | preds = 0 58 | if preds > question.max_score: 59 | preds = question.max_score 60 | else: 61 | preds = 0 62 | 63 | K.clear_session() 64 | essay = Essay.objects.create( 65 | content=content, 66 | question=question, 67 | score=preds 68 | ) 69 | return redirect('essay', question_id=question.set, essay_id=essay.id) 70 | else: 71 | form = AnswerForm() 72 | 73 | context = { 74 | "question": question, 75 | "form": form, 76 | } 77 | return render(request, 'grader/question.html', context) -------------------------------------------------------------------------------- /mysite/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == '__main__': 6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError as exc: 10 | raise ImportError( 11 | "Couldn't import Django. Are you sure it's installed and " 12 | "available on your PYTHONPATH environment variable? Did you " 13 | "forget to activate a virtual environment?" 14 | ) from exc 15 | execute_from_command_line(sys.argv) 16 | -------------------------------------------------------------------------------- /mysite/mysite/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/mysite/__init__.py -------------------------------------------------------------------------------- /mysite/mysite/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/mysite/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/mysite/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/mysite/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/mysite/__pycache__/settings.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/mysite/__pycache__/settings.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/mysite/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/mysite/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/mysite/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/mysite/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/mysite/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/mysite/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/mysite/__pycache__/wsgi.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/mysite/__pycache__/wsgi.cpython-36.pyc -------------------------------------------------------------------------------- /mysite/mysite/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/mysite/mysite/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /mysite/mysite/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for mysite project. 3 | 4 | Generated by 'django-admin startproject' using Django 2.1. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/2.1/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = '7a8(4bh(%&amg0skdnt9t7)(4@&8+^!pl_yco3fssz2_zjab+e' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'widget_tweaks', 35 | 'grader.apps.GraderConfig', 36 | 'django.contrib.admin', 37 | 'django.contrib.auth', 38 | 'django.contrib.contenttypes', 39 | 'django.contrib.sessions', 40 | 'django.contrib.messages', 41 | 'django.contrib.staticfiles', 42 | ] 43 | 44 | MIDDLEWARE = [ 45 | 'django.middleware.security.SecurityMiddleware', 46 | 'django.contrib.sessions.middleware.SessionMiddleware', 47 | 'django.middleware.common.CommonMiddleware', 48 | 'django.middleware.csrf.CsrfViewMiddleware', 49 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 50 | 'django.contrib.messages.middleware.MessageMiddleware', 51 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 52 | ] 53 | 54 | ROOT_URLCONF = 'mysite.urls' 55 | #BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 56 | 57 | TEMPLATES = [ 58 | { 59 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 60 | 'DIRS': [ 61 | os.path.join(BASE_DIR, 'templates'), 62 | ], 63 | 'APP_DIRS': True, 64 | 'OPTIONS': { 65 | 'context_processors': [ 66 | 'django.template.context_processors.debug', 67 | 'django.template.context_processors.request', 68 | 'django.contrib.auth.context_processors.auth', 69 | 'django.contrib.messages.context_processors.messages', 70 | ], 71 | }, 72 | }, 73 | ] 74 | 75 | WSGI_APPLICATION = 'mysite.wsgi.application' 76 | 77 | 78 | # Database 79 | # https://docs.djangoproject.com/en/2.1/ref/settings/#databases 80 | 81 | DATABASES = { 82 | 'default': { 83 | 'ENGINE': 'django.db.backends.sqlite3', 84 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 85 | } 86 | } 87 | 88 | 89 | # Password validation 90 | # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators 91 | 92 | AUTH_PASSWORD_VALIDATORS = [ 93 | { 94 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 95 | }, 96 | { 97 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 98 | }, 99 | { 100 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 101 | }, 102 | { 103 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 104 | }, 105 | ] 106 | 107 | 108 | # Internationalization 109 | # https://docs.djangoproject.com/en/2.1/topics/i18n/ 110 | 111 | LANGUAGE_CODE = 'en-us' 112 | 113 | TIME_ZONE = 'UTC' 114 | 115 | USE_I18N = True 116 | 117 | USE_L10N = True 118 | 119 | USE_TZ = True 120 | 121 | 122 | # Static files (CSS, JavaScript, Images) 123 | # https://docs.djangoproject.com/en/2.1/howto/static-files/ 124 | 125 | STATIC_URL = '/static/' 126 | STATICFILES_DIRS = [ 127 | os.path.join(BASE_DIR, 'static'), 128 | ] -------------------------------------------------------------------------------- /mysite/mysite/urls.py: -------------------------------------------------------------------------------- 1 | """mysite URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import include, path 18 | 19 | 20 | urlpatterns = [ 21 | path('', include('grader.urls')), 22 | path('admin/', admin.site.urls), 23 | ] 24 | -------------------------------------------------------------------------------- /mysite/mysite/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for mysite project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /mysite/templates/base.html: -------------------------------------------------------------------------------- 1 | {% load static %} 2 | 3 | 4 | 5 | {% block title %}Let's Grade Essays{% endblock %} 6 | 7 | 8 | 9 | 10 | 15 | 16 |
17 | 21 | {% block content %} 22 | {% endblock %} 23 |
24 | 25 | -------------------------------------------------------------------------------- /word2vecmodel.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mankadronit/Automated-Essay--Scoring/d04063191c6b70938d995ee1f629bfc36f572c0f/word2vecmodel.bin --------------------------------------------------------------------------------