├── Framework ├── Keras │ ├── Keras Assingment │ │ ├── GirrajJangid_Task1 │ │ │ └── Girrajjangid_Modelwithlogs.ipynb │ │ ├── Harsh_Task1 │ │ │ └── harsh.ipynb │ │ ├── HarshalDesai_Task1 │ │ │ └── HarshalDesai_ModelwithLogs.ipynb │ │ ├── PeddiAshrithKumar_Task1 │ │ │ └── PeddiAshrithKumar_ModelWithLogs.ipynb │ │ ├── Prajwal_Task1 │ │ │ └── Prajwal_ModelWithLogs.ipynb │ │ ├── README.md │ │ ├── RitikJain_Task1 │ │ │ └── RitikJain_wihLogs.ipynb │ │ ├── Shivam_Task1 │ │ │ ├── Shivam_Logs.jpg │ │ │ └── Shivam_Model.py │ │ ├── StutiJain_Task1 │ │ │ └── StutiJain_ModelwithLogs.ipynb │ │ ├── Task_1 │ │ │ ├── README.md │ │ │ └── Task1.md │ │ ├── YugalJain_ModelwithLogs.ipynb │ │ └── YugalJain_ModelwithLogs │ │ │ └── YugalJain_ModelwithLogs.ipynb │ └── README.md └── README.md ├── LICENSE ├── Phase 1 ├── Numpy_Pandas │ ├── Introduction to Pandas.ipynb │ ├── Introduction_To_NumPy.ipynb │ ├── OReilly Python for Data Analysis.pdf │ └── README.md └── Python assignment │ ├── README.md │ ├── Top10.txt │ ├── Top100.txt │ ├── Top15.txt │ ├── Top20.txt │ ├── Top25.txt │ ├── Top30.txt │ ├── Top35.txt │ ├── Top40.txt │ ├── Top45.txt │ ├── Top5.txt │ ├── Top50.txt │ ├── Top60.txt │ ├── Top65.txt │ ├── Top75.txt │ ├── Top80.txt │ ├── Top85.txt │ ├── Top90.txt │ ├── Top95.txt │ ├── resources │ ├── 2600-0.txt │ ├── README.md │ └── stopwords.txt │ ├── top55.txt │ └── top70.txt ├── Phase 2 ├── Supervised_Learning.md └── images │ ├── README.md │ └── supervised_learning.png ├── README.md └── readme_data_preprocessing.txt /Framework/Keras/Keras Assingment/Harsh_Task1/harsh.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 28, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "from keras.utils.np_utils import to_categorical" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": 29, 15 | "metadata": {}, 16 | "outputs": [], 17 | "source": [ 18 | "from keras.datasets import mnist" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": 30, 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "from keras.layers import Dense" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": 31, 33 | "metadata": {}, 34 | "outputs": [], 35 | "source": [ 36 | "from keras.models import Sequential" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": 32, 42 | "metadata": {}, 43 | "outputs": [], 44 | "source": [ 45 | "from keras.callbacks import CSVLogger" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": 33, 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [ 54 | "(X_train, Y_train),(X_test, Y_test) = mnist.load_data()" 55 | ] 56 | }, 57 | { 58 | "cell_type": "code", 59 | "execution_count": 34, 60 | "metadata": {}, 61 | "outputs": [], 62 | "source": [ 63 | "model = Sequential()" 64 | ] 65 | }, 66 | { 67 | "cell_type": "code", 68 | "execution_count": 35, 69 | "metadata": {}, 70 | "outputs": [], 71 | "source": [ 72 | "X_train = X_train.reshape(X_train.shape[0],784)" 73 | ] 74 | }, 75 | { 76 | "cell_type": "code", 77 | "execution_count": 36, 78 | "metadata": {}, 79 | "outputs": [], 80 | "source": [ 81 | "X_test = X_test.reshape(X_test.shape[0], 784)\n" 82 | ] 83 | }, 84 | { 85 | "cell_type": "code", 86 | "execution_count": 37, 87 | "metadata": {}, 88 | "outputs": [], 89 | "source": [ 90 | "X_train = X_train / 255\n", 91 | "X_test = X_test / 255" 92 | ] 93 | }, 94 | { 95 | "cell_type": "code", 96 | "execution_count": 38, 97 | "metadata": {}, 98 | "outputs": [], 99 | "source": [ 100 | "Y_train = to_categorical(Y_train)\n", 101 | "Y_test = to_categorical(Y_test)" 102 | ] 103 | }, 104 | { 105 | "cell_type": "code", 106 | "execution_count": 39, 107 | "metadata": {}, 108 | "outputs": [], 109 | "source": [ 110 | "model.add(Dense(512,input_dim = 784 ,activation = 'relu'))" 111 | ] 112 | }, 113 | { 114 | "cell_type": "code", 115 | "execution_count": 40, 116 | "metadata": {}, 117 | "outputs": [], 118 | "source": [ 119 | "model.add(Dense(10,activation = 'softmax'))" 120 | ] 121 | }, 122 | { 123 | "cell_type": "code", 124 | "execution_count": 41, 125 | "metadata": {}, 126 | "outputs": [], 127 | "source": [ 128 | "model.compile(optimizer = 'adam',loss = 'categorical_crossentropy', metrics=['accuracy'])" 129 | ] 130 | }, 131 | { 132 | "cell_type": "code", 133 | "execution_count": 42, 134 | "metadata": {}, 135 | "outputs": [ 136 | { 137 | "name": "stdout", 138 | "output_type": "stream", 139 | "text": [ 140 | "Train on 60000 samples, validate on 10000 samples\n", 141 | "Epoch 1/10\n", 142 | " - 9s - loss: 0.2155 - acc: 0.9375 - val_loss: 0.1092 - val_acc: 0.9667\n", 143 | "Epoch 2/10\n", 144 | " - 8s - loss: 0.0855 - acc: 0.9741 - val_loss: 0.0788 - val_acc: 0.9757\n", 145 | "Epoch 3/10\n", 146 | " - 8s - loss: 0.0547 - acc: 0.9832 - val_loss: 0.0802 - val_acc: 0.9748\n", 147 | "Epoch 4/10\n", 148 | " - 10s - loss: 0.0395 - acc: 0.9875 - val_loss: 0.0900 - val_acc: 0.9727\n", 149 | "Epoch 5/10\n", 150 | " - 11s - loss: 0.0285 - acc: 0.9907 - val_loss: 0.0681 - val_acc: 0.9796\n", 151 | "Epoch 6/10\n", 152 | " - 9s - loss: 0.0215 - acc: 0.9927 - val_loss: 0.0669 - val_acc: 0.9799\n", 153 | "Epoch 7/10\n", 154 | " - 9s - loss: 0.0166 - acc: 0.9949 - val_loss: 0.0857 - val_acc: 0.9759\n", 155 | "Epoch 8/10\n", 156 | " - 8s - loss: 0.0146 - acc: 0.9953 - val_loss: 0.0830 - val_acc: 0.9764\n", 157 | "Epoch 9/10\n", 158 | " - 8s - loss: 0.0107 - acc: 0.9965 - val_loss: 0.0695 - val_acc: 0.9833\n", 159 | "Epoch 10/10\n", 160 | " - 9s - loss: 0.0089 - acc: 0.9972 - val_loss: 0.0844 - val_acc: 0.9795\n" 161 | ] 162 | }, 163 | { 164 | "data": { 165 | "text/plain": [ 166 | "" 167 | ] 168 | }, 169 | "execution_count": 42, 170 | "metadata": {}, 171 | "output_type": "execute_result" 172 | } 173 | ], 174 | "source": [ 175 | "model.fit(X_train,Y_train, validation_data=(X_test,Y_test),epochs = 10, batch_size = 50, verbose = 2)" 176 | ] 177 | }, 178 | { 179 | "cell_type": "code", 180 | "execution_count": 43, 181 | "metadata": {}, 182 | "outputs": [], 183 | "source": [ 184 | "accuracy = model.evaluate(X_test, Y_test, verbose=0)" 185 | ] 186 | }, 187 | { 188 | "cell_type": "code", 189 | "execution_count": 44, 190 | "metadata": {}, 191 | "outputs": [ 192 | { 193 | "name": "stdout", 194 | "output_type": "stream", 195 | "text": [ 196 | "accuracy is 97.95\n" 197 | ] 198 | } 199 | ], 200 | "source": [ 201 | "print(\"accuracy is %0.2f\" % (accuracy[-1]*100)) " 202 | ] 203 | }, 204 | { 205 | "cell_type": "code", 206 | "execution_count": null, 207 | "metadata": {}, 208 | "outputs": [], 209 | "source": [] 210 | } 211 | ], 212 | "metadata": { 213 | "kernelspec": { 214 | "display_name": "Python 3", 215 | "language": "python", 216 | "name": "python3" 217 | }, 218 | "language_info": { 219 | "codemirror_mode": { 220 | "name": "ipython", 221 | "version": 3 222 | }, 223 | "file_extension": ".py", 224 | "mimetype": "text/x-python", 225 | "name": "python", 226 | "nbconvert_exporter": "python", 227 | "pygments_lexer": "ipython3", 228 | "version": "3.7.3" 229 | } 230 | }, 231 | "nbformat": 4, 232 | "nbformat_minor": 2 233 | } 234 | -------------------------------------------------------------------------------- /Framework/Keras/Keras Assingment/HarshalDesai_Task1/HarshalDesai_ModelwithLogs.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [ 8 | { 9 | "name": "stderr", 10 | "output_type": "stream", 11 | "text": [ 12 | "Using TensorFlow backend.\n" 13 | ] 14 | } 15 | ], 16 | "source": [ 17 | "#Import keras\n", 18 | "import keras\n", 19 | "#Import the MNIST dataset\n", 20 | "from keras.datasets import mnist" 21 | ] 22 | }, 23 | { 24 | "cell_type": "code", 25 | "execution_count": 2, 26 | "metadata": {}, 27 | "outputs": [], 28 | "source": [ 29 | "#Loading dataset into train and test sets\n", 30 | "(X_train, y_train), (X_test, y_test) = mnist.load_data()" 31 | ] 32 | }, 33 | { 34 | "cell_type": "code", 35 | "execution_count": 3, 36 | "metadata": {}, 37 | "outputs": [], 38 | "source": [ 39 | "#Normalize the dataset\n", 40 | "X_train = keras.utils.normalize(X_train, axis=1)\n", 41 | "X_test = keras.utils.normalize(X_test, axis=1)" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": 4, 47 | "metadata": {}, 48 | "outputs": [], 49 | "source": [ 50 | "# Import `Sequential` from `keras.models`\n", 51 | "from keras.models import Sequential" 52 | ] 53 | }, 54 | { 55 | "cell_type": "code", 56 | "execution_count": 6, 57 | "metadata": {}, 58 | "outputs": [], 59 | "source": [ 60 | "#Initialize the model\n", 61 | "model = keras.models.Sequential()" 62 | ] 63 | }, 64 | { 65 | "cell_type": "code", 66 | "execution_count": 7, 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [ 70 | "#Adding input layer by flattening the 28x28 pixels image into a vector of size 784 \n", 71 | "#Using Flatten()\n", 72 | "model.add(keras.layers.Flatten())" 73 | ] 74 | }, 75 | { 76 | "cell_type": "code", 77 | "execution_count": 8, 78 | "metadata": {}, 79 | "outputs": [], 80 | "source": [ 81 | "# Import `Dense` from `keras.layers`\n", 82 | "from keras.layers import Dense\n", 83 | "#Adding hidden layer of size 512 with activation function Relu\n", 84 | "model.add(keras.layers.Dense(512, activation='relu'))" 85 | ] 86 | }, 87 | { 88 | "cell_type": "code", 89 | "execution_count": 9, 90 | "metadata": {}, 91 | "outputs": [], 92 | "source": [ 93 | "#Adding output layer of size 10 with activation softmax\n", 94 | "model.add(keras.layers.Dense(10, activation='softmax'))" 95 | ] 96 | }, 97 | { 98 | "cell_type": "code", 99 | "execution_count": 11, 100 | "metadata": {}, 101 | "outputs": [], 102 | "source": [ 103 | "#Compiling the model by using the sgd optimizer\n", 104 | "model.compile(optimizer='sgd',loss='sparse_categorical_crossentropy',metrics=['accuracy'])" 105 | ] 106 | }, 107 | { 108 | "cell_type": "code", 109 | "execution_count": 13, 110 | "metadata": {}, 111 | "outputs": [ 112 | { 113 | "name": "stdout", 114 | "output_type": "stream", 115 | "text": [ 116 | "Epoch 1/10\n", 117 | "60000/60000 [==============================] - 13s 221us/step - loss: 0.2341 - acc: 0.9349\n", 118 | "Epoch 2/10\n", 119 | "60000/60000 [==============================] - 14s 230us/step - loss: 0.2259 - acc: 0.9367\n", 120 | "Epoch 3/10\n", 121 | "60000/60000 [==============================] - 14s 225us/step - loss: 0.2181 - acc: 0.9385\n", 122 | "Epoch 4/10\n", 123 | "60000/60000 [==============================] - 10s 171us/step - loss: 0.2111 - acc: 0.9408\n", 124 | "Epoch 5/10\n", 125 | "60000/60000 [==============================] - 10s 168us/step - loss: 0.2044 - acc: 0.9425\n", 126 | "Epoch 6/10\n", 127 | "60000/60000 [==============================] - 14s 237us/step - loss: 0.1981 - acc: 0.9440\n", 128 | "Epoch 7/10\n", 129 | "60000/60000 [==============================] - 14s 235us/step - loss: 0.1922 - acc: 0.9455\n", 130 | "Epoch 8/10\n", 131 | "60000/60000 [==============================] - 14s 231us/step - loss: 0.1866 - acc: 0.9474\n", 132 | "Epoch 9/10\n", 133 | "60000/60000 [==============================] - 14s 238us/step - loss: 0.1814 - acc: 0.9490\n", 134 | "Epoch 10/10\n", 135 | "60000/60000 [==============================] - 14s 239us/step - loss: 0.1764 - acc: 0.9506\n" 136 | ] 137 | }, 138 | { 139 | "data": { 140 | "text/plain": [ 141 | "" 142 | ] 143 | }, 144 | "execution_count": 13, 145 | "metadata": {}, 146 | "output_type": "execute_result" 147 | } 148 | ], 149 | "source": [ 150 | "#Training the model\n", 151 | "model.fit(X_train, y_train, epochs=10,batch_size=32, verbose=1)" 152 | ] 153 | }, 154 | { 155 | "cell_type": "code", 156 | "execution_count": 15, 157 | "metadata": {}, 158 | "outputs": [ 159 | { 160 | "name": "stdout", 161 | "output_type": "stream", 162 | "text": [ 163 | "10000/10000 [==============================] - 1s 64us/step\n", 164 | "Loss: 0.18251839239299297\n", 165 | "Accuarcy: 94.69999999999999%\n" 166 | ] 167 | } 168 | ], 169 | "source": [ 170 | "#Evaluating the model on the test dataset\n", 171 | "val_loss, val_acc = model.evaluate(X_test, y_test)\n", 172 | "print(\"Loss: \" + str(val_loss))\n", 173 | "print(\"Accuarcy: \" + str(100*val_acc) + \"%\")" 174 | ] 175 | }, 176 | { 177 | "cell_type": "code", 178 | "execution_count": null, 179 | "metadata": {}, 180 | "outputs": [], 181 | "source": [] 182 | } 183 | ], 184 | "metadata": { 185 | "kernelspec": { 186 | "display_name": "Python 3", 187 | "language": "python", 188 | "name": "python3" 189 | }, 190 | "language_info": { 191 | "codemirror_mode": { 192 | "name": "ipython", 193 | "version": 3 194 | }, 195 | "file_extension": ".py", 196 | "mimetype": "text/x-python", 197 | "name": "python", 198 | "nbconvert_exporter": "python", 199 | "pygments_lexer": "ipython3", 200 | "version": "3.7.3" 201 | } 202 | }, 203 | "nbformat": 4, 204 | "nbformat_minor": 2 205 | } 206 | -------------------------------------------------------------------------------- /Framework/Keras/Keras Assingment/PeddiAshrithKumar_Task1/PeddiAshrithKumar_ModelWithLogs.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 172, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import pandas as pd\n", 10 | "import numpy as np\n", 11 | "from keras.models import Sequential\n", 12 | "from keras.layers import Dense\n", 13 | "from keras.datasets import mnist\n", 14 | "from keras.utils import to_categorical\n", 15 | "import matplotlib.pyplot as plt" 16 | ] 17 | }, 18 | { 19 | "cell_type": "code", 20 | "execution_count": 173, 21 | "metadata": {}, 22 | "outputs": [], 23 | "source": [ 24 | "#loading the data\n", 25 | "(x_train, y_train), (x_test, y_test) = mnist.load_data()" 26 | ] 27 | }, 28 | { 29 | "cell_type": "code", 30 | "execution_count": 174, 31 | "metadata": {}, 32 | "outputs": [ 33 | { 34 | "data": { 35 | "text/plain": [ 36 | "(60000, 28, 28)" 37 | ] 38 | }, 39 | "execution_count": 174, 40 | "metadata": {}, 41 | "output_type": "execute_result" 42 | } 43 | ], 44 | "source": [ 45 | "#checking the shape of data\n", 46 | "x_train.shape" 47 | ] 48 | }, 49 | { 50 | "cell_type": "code", 51 | "execution_count": 175, 52 | "metadata": {}, 53 | "outputs": [], 54 | "source": [ 55 | "#scaling from (0,255) to (0,1)\n", 56 | "x_train = x_train / 255.0\n", 57 | "x_test = x_test / 255.0" 58 | ] 59 | }, 60 | { 61 | "cell_type": "code", 62 | "execution_count": 176, 63 | "metadata": {}, 64 | "outputs": [ 65 | { 66 | "data": { 67 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAATMAAAEoCAYAAAA0SRYGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAF5xJREFUeJzt3XuQXGWZx/Hvz8ltCRGJgRhDJFkMSgQNOMtloSAUF4PFEimVizd0WeMiUdHoGlkLWFarYFegECPrIDFgcUdYZncjUbMq6kLMgAgkCMQYJS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L8ANNzCwPvJ6ZmeVGRpbN9qRZMysrgOiLml+VVFpsQtJYSTcU4yuLd0YkuZiZWXlRfKBJra+EKhebOB14KiLeClwCXFgpVRczM0tqQMusmsUmShcBuBk4qji5uCwXMzNLq3PLjOoWm3hln4jYATwDvDF1UA8AmFlZ23lq+U/i5klD+Oq4AQubdkVEQ59r4GJmZmVFxGCLbg5XNYtN9O+zQdIoYBfgydRB3c00s5FWzWITpYsAfAD476hw76VbZmY2osotNiHpfKAnIroprCLyfUlrKaxifEql4/pGczPLBXczzSwXXMzMLBdczMwsF1zMzCwXXMzMLBdczMwsF1zMzCwXXMzMLBf+D2vvyRg3E/TIAAAAAElFTkSuQmCC\n", 68 | "text/plain": [ 69 | "
" 70 | ] 71 | }, 72 | "metadata": { 73 | "needs_background": "light" 74 | }, 75 | "output_type": "display_data" 76 | }, 77 | { 78 | "name": "stdout", 79 | "output_type": "stream", 80 | "text": [ 81 | "Digit is 5\n" 82 | ] 83 | } 84 | ], 85 | "source": [ 86 | "#sample picture of one digit\n", 87 | "plt.figure(figsize = (5,5))\n", 88 | "plt.imshow(x_train[0])\n", 89 | "plt.colorbar()\n", 90 | "plt.grid(False)\n", 91 | "plt.show()\n", 92 | "print(\"Digit is \",y_train[0])" 93 | ] 94 | }, 95 | { 96 | "cell_type": "code", 97 | "execution_count": 177, 98 | "metadata": { 99 | "scrolled": true 100 | }, 101 | "outputs": [ 102 | { 103 | "data": { 104 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAkAAAAI/CAYAAACf7mYiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzs3Xd81EX+x/HPZBMICT30DobQEQREUbFgP8UCFpSzi4qABcud5/08ey+IiAUBKxYU+6mnIjZAiig9dOm9QyDJzu8PuJmdvSxuyma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WGKaU+UUrlK6UeDbo+qD2l1ENKqV1KqVyl1NSg64PaU0otU0odV0rtCrouqBuXnqUTDSAReUhE9gRdCdSNUipWROaLyDdFpKeIjFJK9Qy2VqgNpVRvERknIoNEpI+IjFBKpQdbK9TBchEZFnQlEBbLxZFnGfUNIKVUqogMF5ElQdcFdTZIRPI9z9vred5lEXlZRO4KuE6onWtF5APP84o8zysVkY0i8p2A64Ra8jzvPRE5HXQ9UHcuPcuobwCJyDwRmSEi5UFXBHXWQUQO+K4PfvFraHx2ichNSqmrlVLNROR2EekYcJ0AOCSqG0BKqREictzzvB1B1wWA4XneHhGZLSJ/EpH/E5GdIlIWaKUAOCWqG0AikiUidyqlCuTKcMktSqnfBlsl1MEhsXsJUr/4NTRCnuct9Tyvv+d5Q0TkjIjkBV0nAO6I6gaQ53k/8zwv1fO8LiIyUkTe9jzvhwFXC7W3TUQylFJdlVIJcuWZrg24TqglpVS7L/7bSa7M/1kZbI0AuCSqG0CILl9Mlp0kIuvlyqq+1Z7n5QZbK9TBK0qp3SKyTkQmep5XGHSFUDtKqVUikiMi3ZVSB5VSY4OuE2rHpWfJURgAAMA59AABAADn0AACAADOoQEEAACcQwMIAAA4hwYQAABwDg0gAADgHBpAAADAOTSAAACAc/4f1Yq8keGPX7QAAAAASUVORK5CYII=\n", 105 | "text/plain": [ 106 | "
" 107 | ] 108 | }, 109 | "metadata": {}, 110 | "output_type": "display_data" 111 | } 112 | ], 113 | "source": [ 114 | "#examples of digits\n", 115 | "plt.figure(figsize=(10,10))\n", 116 | "for i in range(25):\n", 117 | " plt.subplot(5,5,i+1)\n", 118 | " plt.xticks([])\n", 119 | " plt.yticks([])\n", 120 | " plt.grid(False)\n", 121 | " plt.imshow(x_train[i])\n", 122 | " plt.xlabel(y_train[i])\n", 123 | "plt.show()" 124 | ] 125 | }, 126 | { 127 | "cell_type": "code", 128 | "execution_count": 178, 129 | "metadata": {}, 130 | "outputs": [], 131 | "source": [ 132 | "#initializing the model\n", 133 | "model = Sequential()\n", 134 | "\n", 135 | "#adding the hidden layer\n", 136 | "#using relu as activation function\n", 137 | "model.add(Dense(512, input_dim=784, activation='relu'))\n", 138 | "\n", 139 | "#adding output layer\n", 140 | "model.add(Dense(10, activation='softmax'))" 141 | ] 142 | }, 143 | { 144 | "cell_type": "code", 145 | "execution_count": 179, 146 | "metadata": {}, 147 | "outputs": [ 148 | { 149 | "name": "stdout", 150 | "output_type": "stream", 151 | "text": [ 152 | "_________________________________________________________________\n", 153 | "Layer (type) Output Shape Param # \n", 154 | "=================================================================\n", 155 | "dense_15 (Dense) (None, 512) 401920 \n", 156 | "_________________________________________________________________\n", 157 | "dense_16 (Dense) (None, 10) 5130 \n", 158 | "=================================================================\n", 159 | "Total params: 407,050\n", 160 | "Trainable params: 407,050\n", 161 | "Non-trainable params: 0\n", 162 | "_________________________________________________________________\n" 163 | ] 164 | } 165 | ], 166 | "source": [ 167 | "model.summary()" 168 | ] 169 | }, 170 | { 171 | "cell_type": "code", 172 | "execution_count": 180, 173 | "metadata": {}, 174 | "outputs": [], 175 | "source": [ 176 | "#Reshaping of data\n", 177 | "x_train = x_train.reshape(x_train.shape[0],784)\n", 178 | "x_test = x_test.reshape(x_test.shape[0], 784)" 179 | ] 180 | }, 181 | { 182 | "cell_type": "code", 183 | "execution_count": 181, 184 | "metadata": {}, 185 | "outputs": [ 186 | { 187 | "data": { 188 | "text/plain": [ 189 | "(60000, 784)" 190 | ] 191 | }, 192 | "execution_count": 181, 193 | "metadata": {}, 194 | "output_type": "execute_result" 195 | } 196 | ], 197 | "source": [ 198 | "#checking shape after reshaping\n", 199 | "x_train.shape" 200 | ] 201 | }, 202 | { 203 | "cell_type": "code", 204 | "execution_count": 182, 205 | "metadata": {}, 206 | "outputs": [], 207 | "source": [ 208 | "y_train = to_categorical(y_train)\n", 209 | "y_test = to_categorical(y_test)" 210 | ] 211 | }, 212 | { 213 | "cell_type": "code", 214 | "execution_count": 183, 215 | "metadata": {}, 216 | "outputs": [ 217 | { 218 | "name": "stdout", 219 | "output_type": "stream", 220 | "text": [ 221 | "[0. 0. 0. 0. 0. 1. 0. 0. 0. 0.]\n", 222 | "(10,)\n" 223 | ] 224 | } 225 | ], 226 | "source": [ 227 | "print(y_train[0])\n", 228 | "print(y_train[0].shape)" 229 | ] 230 | }, 231 | { 232 | "cell_type": "code", 233 | "execution_count": 184, 234 | "metadata": {}, 235 | "outputs": [], 236 | "source": [ 237 | "#compiling the model\n", 238 | "model.compile(optimizer='adam',loss='categorical_crossentropy',metrics=['accuracy'])" 239 | ] 240 | }, 241 | { 242 | "cell_type": "code", 243 | "execution_count": 185, 244 | "metadata": {}, 245 | "outputs": [ 246 | { 247 | "name": "stdout", 248 | "output_type": "stream", 249 | "text": [ 250 | "Epoch 1/10\n", 251 | "60000/60000 [==============================] - 15s 252us/step - loss: 0.1997 - acc: 0.9412\n", 252 | "Epoch 2/10\n", 253 | "60000/60000 [==============================] - 15s 243us/step - loss: 0.0797 - acc: 0.9756\n", 254 | "Epoch 3/10\n", 255 | "60000/60000 [==============================] - 12s 200us/step - loss: 0.0531 - acc: 0.9834\n", 256 | "Epoch 4/10\n", 257 | "60000/60000 [==============================] - 11s 189us/step - loss: 0.0368 - acc: 0.9877\n", 258 | "Epoch 5/10\n", 259 | "60000/60000 [==============================] - 11s 185us/step - loss: 0.0265 - acc: 0.9913\n", 260 | "Epoch 6/10\n", 261 | "60000/60000 [==============================] - 13s 221us/step - loss: 0.0209 - acc: 0.9935\n", 262 | "Epoch 7/10\n", 263 | "60000/60000 [==============================] - 12s 204us/step - loss: 0.0184 - acc: 0.9938\n", 264 | "Epoch 8/10\n", 265 | "60000/60000 [==============================] - 12s 206us/step - loss: 0.0141 - acc: 0.9952\n", 266 | "Epoch 9/10\n", 267 | "60000/60000 [==============================] - 12s 201us/step - loss: 0.0117 - acc: 0.9962\n", 268 | "Epoch 10/10\n", 269 | "60000/60000 [==============================] - 13s 215us/step - loss: 0.0119 - acc: 0.9961\n" 270 | ] 271 | }, 272 | { 273 | "data": { 274 | "text/plain": [ 275 | "" 276 | ] 277 | }, 278 | "execution_count": 185, 279 | "metadata": {}, 280 | "output_type": "execute_result" 281 | } 282 | ], 283 | "source": [ 284 | "#fitting the model \n", 285 | "model.fit(x_train, y_train, epochs=10, batch_size=32)" 286 | ] 287 | }, 288 | { 289 | "cell_type": "code", 290 | "execution_count": 186, 291 | "metadata": {}, 292 | "outputs": [ 293 | { 294 | "name": "stdout", 295 | "output_type": "stream", 296 | "text": [ 297 | "10000/10000 [==============================] - 0s 28us/step\n", 298 | "Loss is = 0.09107388561827574\n", 299 | "Test accuracy is = 0.98\n" 300 | ] 301 | } 302 | ], 303 | "source": [ 304 | "#Evaluating the model\n", 305 | "loss, accuracy = model.evaluate(x_test, y_test)\n", 306 | "print(\"Loss is = \", loss)\n", 307 | "print('Test accuracy is = %0.2f' % accuracy)" 308 | ] 309 | }, 310 | { 311 | "cell_type": "code", 312 | "execution_count": null, 313 | "metadata": {}, 314 | "outputs": [], 315 | "source": [] 316 | } 317 | ], 318 | "metadata": { 319 | "kernelspec": { 320 | "display_name": "Python 3", 321 | "language": "python", 322 | "name": "python3" 323 | }, 324 | "language_info": { 325 | "codemirror_mode": { 326 | "name": "ipython", 327 | "version": 3 328 | }, 329 | "file_extension": ".py", 330 | "mimetype": "text/x-python", 331 | "name": "python", 332 | "nbconvert_exporter": "python", 333 | "pygments_lexer": "ipython3", 334 | "version": "3.7.3" 335 | } 336 | }, 337 | "nbformat": 4, 338 | "nbformat_minor": 2 339 | } 340 | -------------------------------------------------------------------------------- /Framework/Keras/Keras Assingment/Prajwal_Task1/Prajwal_ModelWithLogs.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [ 8 | { 9 | "name": "stderr", 10 | "output_type": "stream", 11 | "text": [ 12 | "Using TensorFlow backend.\n" 13 | ] 14 | } 15 | ], 16 | "source": [ 17 | "# Import statements\n", 18 | "import keras\n", 19 | "import numpy as np\n", 20 | "from keras.datasets import mnist\n", 21 | "from keras.models import Sequential\n", 22 | "from keras.layers import Dense\n", 23 | "from keras.utils.np_utils import to_categorical" 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": 2, 29 | "metadata": {}, 30 | "outputs": [], 31 | "source": [ 32 | "# Loading the training set and test set\n", 33 | "(X_train, y_train), (X_test, y_test) = mnist.load_data()" 34 | ] 35 | }, 36 | { 37 | "cell_type": "code", 38 | "execution_count": 3, 39 | "metadata": {}, 40 | "outputs": [], 41 | "source": [ 42 | "# Normalizing the data\n", 43 | "X_train = (X_train-X_train.mean())/(X_train.max()-X_train.min())\n", 44 | "X_test = (X_test-X_test.mean())/(X_test.max()-X_test.min())" 45 | ] 46 | }, 47 | { 48 | "cell_type": "code", 49 | "execution_count": 4, 50 | "metadata": {}, 51 | "outputs": [], 52 | "source": [ 53 | "# Reshaping the data\n", 54 | "X_train = X_train.reshape(X_train.shape[0],784)\n", 55 | "X_test = X_test.reshape(X_test.shape[0],784)" 56 | ] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": 5, 61 | "metadata": {}, 62 | "outputs": [], 63 | "source": [ 64 | "# Hot encoding the data\n", 65 | "y_train = to_categorical(y_train)\n", 66 | "y_test = to_categorical(y_test)" 67 | ] 68 | }, 69 | { 70 | "cell_type": "code", 71 | "execution_count": 6, 72 | "metadata": {}, 73 | "outputs": [], 74 | "source": [ 75 | "# Initializing the model\n", 76 | "model = Sequential()\n", 77 | "# Adding a hidden layer of 512 size\n", 78 | "model.add(Dense(512, input_dim=784, activation='relu'))\n", 79 | "# Adding an output layer of 10 size\n", 80 | "model.add(Dense(10, activation='softmax'))" 81 | ] 82 | }, 83 | { 84 | "cell_type": "code", 85 | "execution_count": 7, 86 | "metadata": {}, 87 | "outputs": [], 88 | "source": [ 89 | "# Compiling the model\n", 90 | "model.compile(optimizer='adam',loss='categorical_crossentropy',metrics=['accuracy'])" 91 | ] 92 | }, 93 | { 94 | "cell_type": "code", 95 | "execution_count": 8, 96 | "metadata": {}, 97 | "outputs": [ 98 | { 99 | "name": "stdout", 100 | "output_type": "stream", 101 | "text": [ 102 | "Epoch 1/10\n", 103 | "60000/60000 [==============================] - 17s 288us/step - loss: 0.2044 - acc: 0.9396\n", 104 | "Epoch 2/10\n", 105 | "60000/60000 [==============================] - 16s 274us/step - loss: 0.0821 - acc: 0.9748\n", 106 | "Epoch 3/10\n", 107 | "60000/60000 [==============================] - 17s 282us/step - loss: 0.0558 - acc: 0.9820\n", 108 | "Epoch 4/10\n", 109 | "60000/60000 [==============================] - 17s 282us/step - loss: 0.0407 - acc: 0.9867\n", 110 | "Epoch 5/10\n", 111 | "60000/60000 [==============================] - 17s 284us/step - loss: 0.0293 - acc: 0.9905\n", 112 | "Epoch 6/10\n", 113 | "60000/60000 [==============================] - 17s 284us/step - loss: 0.0254 - acc: 0.9914\n", 114 | "Epoch 7/10\n", 115 | "60000/60000 [==============================] - 17s 283us/step - loss: 0.0204 - acc: 0.9934\n", 116 | "Epoch 8/10\n", 117 | "60000/60000 [==============================] - 17s 290us/step - loss: 0.0187 - acc: 0.9938\n", 118 | "Epoch 9/10\n", 119 | "60000/60000 [==============================] - 17s 288us/step - loss: 0.0139 - acc: 0.9951\n", 120 | "Epoch 10/10\n", 121 | "60000/60000 [==============================] - 17s 290us/step - loss: 0.0137 - acc: 0.9955\n" 122 | ] 123 | }, 124 | { 125 | "data": { 126 | "text/plain": [ 127 | "" 128 | ] 129 | }, 130 | "execution_count": 8, 131 | "metadata": {}, 132 | "output_type": "execute_result" 133 | } 134 | ], 135 | "source": [ 136 | "# Fitting the model\n", 137 | "model.fit(X_train, y_train, epochs=10, batch_size=32)" 138 | ] 139 | }, 140 | { 141 | "cell_type": "code", 142 | "execution_count": 9, 143 | "metadata": {}, 144 | "outputs": [ 145 | { 146 | "name": "stdout", 147 | "output_type": "stream", 148 | "text": [ 149 | "10000/10000 [==============================] - 1s 61us/step\n", 150 | "Loss = 0.08458407581392612\n", 151 | "Accuracy = 0.9801\n" 152 | ] 153 | } 154 | ], 155 | "source": [ 156 | "# Evaluating the model\n", 157 | "loss, acc = model.evaluate(X_test, y_test)\n", 158 | "print(\"Loss = \", loss)\n", 159 | "print(\"Accuracy = \", acc)" 160 | ] 161 | }, 162 | { 163 | "cell_type": "code", 164 | "execution_count": null, 165 | "metadata": {}, 166 | "outputs": [], 167 | "source": [] 168 | } 169 | ], 170 | "metadata": { 171 | "kernelspec": { 172 | "display_name": "Python 3", 173 | "language": "python", 174 | "name": "python3" 175 | }, 176 | "language_info": { 177 | "codemirror_mode": { 178 | "name": "ipython", 179 | "version": 3 180 | }, 181 | "file_extension": ".py", 182 | "mimetype": "text/x-python", 183 | "name": "python", 184 | "nbconvert_exporter": "python", 185 | "pygments_lexer": "ipython3", 186 | "version": "3.7.3" 187 | } 188 | }, 189 | "nbformat": 4, 190 | "nbformat_minor": 2 191 | } 192 | -------------------------------------------------------------------------------- /Framework/Keras/Keras Assingment/README.md: -------------------------------------------------------------------------------- 1 | Please check the **TASK1** problem statement in the task1 folder. 2 | -------------------------------------------------------------------------------- /Framework/Keras/Keras Assingment/Shivam_Task1/Shivam_Logs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oss2019/text-summarization/7387e695d011d34a63eaa232c312f6cbf3e32b61/Framework/Keras/Keras Assingment/Shivam_Task1/Shivam_Logs.jpg -------------------------------------------------------------------------------- /Framework/Keras/Keras Assingment/Shivam_Task1/Shivam_Model.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | from keras.datasets import mnist 3 | from keras.models import Sequential 4 | from keras.layers import Dense 5 | from keras.utils import np_utils 6 | from keras.callbacks import CSVLogger 7 | 8 | (X_train, Y_train),(X_test, Y_test) = mnist.load_data() 9 | 10 | # print(Y_test.shape) 11 | # print(X_train) 12 | 13 | X_train = X_train.reshape(X_train.shape[0],784) 14 | X_test = X_test.reshape(X_test.shape[0], 784) 15 | 16 | 17 | X_train = X_train / 255 18 | X_test = X_test / 255 19 | 20 | Y_train = np_utils.to_categorical(Y_train) 21 | Y_test = np_utils.to_categorical(Y_test) 22 | # print(Y_test.shape[1]) 23 | 24 | model = Sequential() 25 | model.add(Dense(512,input_dim = 784 ,activation = 'relu')) 26 | model.add(Dense(10,activation = 'softmax')) 27 | 28 | model.compile(loss = 'categorical_crossentropy', optimizer = 'adam', metrics=['accuracy']) 29 | 30 | csv_logger = CSVLogger('Shivam_Logs.txt') 31 | model.fit(X_train,Y_train, validation_data=(X_test,Y_test),epochs = 10, batch_size = 100, verbose = 2) 32 | 33 | scores = model.evaluate(X_test, Y_test, verbose=0) 34 | 35 | print("Accuracy: %.2f%%" % (scores[1]*100)) -------------------------------------------------------------------------------- /Framework/Keras/Keras Assingment/StutiJain_Task1/StutiJain_ModelwithLogs.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 36, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import numpy as np\n", 10 | "import matplotlib.pyplot as plt\n", 11 | "import pandas as pd\n", 12 | "import tensorflow as tf" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": 37, 18 | "metadata": {}, 19 | "outputs": [], 20 | "source": [ 21 | "mnist = tf.keras.datasets.mnist" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": 38, 27 | "metadata": {}, 28 | "outputs": [], 29 | "source": [ 30 | "(x_train, y_train),(x_test, y_test) = mnist.load_data()\n", 31 | "x_train = tf.keras.utils.normalize(x_train, axis=1)\n", 32 | "x_test = tf.keras.utils.normalize(x_test, axis=1)" 33 | ] 34 | }, 35 | { 36 | "cell_type": "code", 37 | "execution_count": 39, 38 | "metadata": {}, 39 | "outputs": [ 40 | { 41 | "name": "stdout", 42 | "output_type": "stream", 43 | "text": [ 44 | "(60000, 28, 28)\n" 45 | ] 46 | } 47 | ], 48 | "source": [ 49 | "print(x_train.shape)" 50 | ] 51 | }, 52 | { 53 | "cell_type": "code", 54 | "execution_count": 42, 55 | "metadata": {}, 56 | "outputs": [], 57 | "source": [ 58 | "model = tf.keras.models.Sequential()\n", 59 | "model.add(tf.keras.layers.Flatten())" 60 | ] 61 | }, 62 | { 63 | "cell_type": "code", 64 | "execution_count": 43, 65 | "metadata": {}, 66 | "outputs": [ 67 | { 68 | "name": "stdout", 69 | "output_type": "stream", 70 | "text": [ 71 | "Epoch 1/5\n", 72 | "60000/60000 [==============================] - 13s 220us/sample - loss: 0.1988 - acc: 0.9397\n", 73 | "Epoch 2/5\n", 74 | "60000/60000 [==============================] - 13s 220us/sample - loss: 0.0810 - acc: 0.9751\n", 75 | "Epoch 3/5\n", 76 | "60000/60000 [==============================] - 13s 221us/sample - loss: 0.0522 - acc: 0.9832\n", 77 | "Epoch 4/5\n", 78 | "60000/60000 [==============================] - 13s 214us/sample - loss: 0.0386 - acc: 0.9873\n", 79 | "Epoch 5/5\n", 80 | "60000/60000 [==============================] - 13s 211us/sample - loss: 0.0287 - acc: 0.9905\n" 81 | ] 82 | }, 83 | { 84 | "data": { 85 | "text/plain": [ 86 | "" 87 | ] 88 | }, 89 | "execution_count": 43, 90 | "metadata": {}, 91 | "output_type": "execute_result" 92 | } 93 | ], 94 | "source": [ 95 | "model.add(tf.keras.layers.Dense(512 ,activation=tf.nn.relu))\n", 96 | "model.add(tf.keras.layers.Dense(512, activation=tf.nn.relu))\n", 97 | "model.add(tf.keras.layers.Dense(10, activation=tf.nn.softmax))\n", 98 | "model.compile(optimizer='adam',\n", 99 | " loss='sparse_categorical_crossentropy',\n", 100 | " metrics=['accuracy'])\n", 101 | "model.fit(x_train, y_train, epochs=5)\n" 102 | ] 103 | }, 104 | { 105 | "cell_type": "code", 106 | "execution_count": 44, 107 | "metadata": {}, 108 | "outputs": [ 109 | { 110 | "data": { 111 | "text/plain": [ 112 | "" 113 | ] 114 | }, 115 | "execution_count": 44, 116 | "metadata": {}, 117 | "output_type": "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ZU1X00IiZDZrZfjPbZ2b1invZamYjZnZg3LLZZvaamR3ObiecY6+i3jab2Z+z126fma2tqLc+M/ujmR00s/fM7PvZ8kpfu0RfbXnd2v6Z3cymSjok6QFJQ5L2Slrv7v/X1kYaMLNBSTV3r/wADDP7uqRzkn7t7ndny/5D0hl3fyb7QznL3f+9Q3rbLOlc1dN4Z7MVzR8/zbikRyT9qyp87RJ9/Yva8LpVsWcfkHTE3Y+6+18kbZe0roI+Op6775Z05qrF6yRty+5v09h/lrZr0FtHcPdhd387u/+ppCvTjFf62iX6aosqwr5Q0olxvw+ps+Z7d0l/MLO3zGxj1c1MYJ67D0tj/3kkza24n6vlTuPdTldNM94xr10z058XVUXYJ5pKqpPG/1a7+9ckPSTpieztKiZnUtN4t8sE04x3hGanPy+qirAPSeob9/siSScr6GNC7n4yux2R9LI6byrqU1dm0M1uRyru5286aRrviaYZVwe8dlVOf15F2PdKusPMlphZt6TvSNpRQR/XMLOe7IsTmVmPpG+q86ai3iFpQ3Z/g6RXKuzlSzplGu9G04yr4teu8unP3b3tP5LWauwb+Q8k/bCKHhr09Q+S3sl+3qu6N0kvaext3ecae0f0mKTbJO2SdDi7nd1Bvb0oab+kdzUWrPkV9fZPGvto+K6kfdnP2qpfu0RfbXndOFwWCIIj6IAgCDsQBGEHgiDsQBCEHQiCsANBEHYgiL8CObYutWTbTN8AAAAASUVORK5CYII=\n", 122 | "text/plain": [ 123 | "
" 124 | ] 125 | }, 126 | "metadata": { 127 | "needs_background": "light" 128 | }, 129 | "output_type": "display_data" 130 | } 131 | ], 132 | "source": [ 133 | "plt.imshow(x_train[0], cmap = plt.cm.binary)\n", 134 | "plt.show" 135 | ] 136 | }, 137 | { 138 | "cell_type": "code", 139 | "execution_count": 45, 140 | "metadata": {}, 141 | "outputs": [ 142 | { 143 | "name": "stdout", 144 | "output_type": "stream", 145 | "text": [ 146 | "10000/10000 [==============================] - 1s 85us/sample - loss: 0.0844 - acc: 0.9782\n", 147 | "Loss is 0.08439339621820836\n", 148 | "Accuracy is 0.9782\n" 149 | ] 150 | } 151 | ], 152 | "source": [ 153 | "val_loss, val_acc = model.evaluate(x_test, y_test)\n", 154 | "print(\"Loss is\", val_loss)\n", 155 | "print(\"Accuracy is\",val_acc)" 156 | ] 157 | }, 158 | { 159 | "cell_type": "code", 160 | "execution_count": null, 161 | "metadata": {}, 162 | "outputs": [], 163 | "source": [] 164 | } 165 | ], 166 | "metadata": { 167 | "kernelspec": { 168 | "display_name": "Python 3", 169 | "language": "python", 170 | "name": "python3" 171 | }, 172 | "language_info": { 173 | "codemirror_mode": { 174 | "name": "ipython", 175 | "version": 3 176 | }, 177 | "file_extension": ".py", 178 | "mimetype": "text/x-python", 179 | "name": "python", 180 | "nbconvert_exporter": "python", 181 | "pygments_lexer": "ipython3", 182 | "version": "3.7.2" 183 | } 184 | }, 185 | "nbformat": 4, 186 | "nbformat_minor": 2 187 | } 188 | -------------------------------------------------------------------------------- /Framework/Keras/Keras Assingment/Task_1/README.md: -------------------------------------------------------------------------------- 1 | # MNIST (Modified National Institute of Standards and Technology database) 2 | - Database of handwritten digits(0-9) that is commonly used for training various image classification tasks. 3 | - Contains 60,000 training images and 10,000 testing images each of 28x28 pixel in grayscale. 4 | - Composed by 500 differenct writers including American Census Bureau employees and American high school students. 5 | 6 | ## TASK 7 | - The task is to build a classifier which can classify the set of images into 10 different classes(*categories*) one for each digit. 8 | - Understand and build a classifier in **Keras** having an architecture: 9 | - One hidden layer of size 512 10 | - Output layer of size 10 (*Number of classes*) 11 | - For the input layer, stack all the 28x28 pixels of an image into a vector of size 784 (*Can be done using numpy*) and feed into the model. 12 | 13 | ## PROCESS 14 | ### 1. Dataset preprocessing or structuring 15 | Keras has inbuilt mnist dataset. Can be directly imported and used for making train and test datasets. 16 | ### 2. Designing the model 17 | - Keras providies us with two main types of models: 18 | 1. The Sequential Model 19 | 2. Model class with functional API 20 | - Please find more about the two options from Keras Docs. For this assignment we'll be using sequential model. 21 | - While adding layers to the sequential model, keras also takes as argument the activation function which you would like to use for each layer. Please find more about the available activation functions from [here](https://keras.io/activations/). 22 | ### 3. Compiling the model 23 | Compile in Keras defines the loss function, the optimizer and the metrics for the model training. 24 | Please find the list of available optimizers in keras from [here](https://keras.io/optimizers/). 25 | ### 4. Training the Model 26 | After preparing the dataset and compiling the model, our model now is ready to get trained on the mnist dataset. Keras does all the job of training the model on the dataset using a simple command **fit** which also returns the training history logs. 27 | ### 5. Evaluating the model 28 | Finally, after training the model, we check its performance on the test dataset using the **evaluate** method. 29 | 30 | ## CONTRIBUTING 31 | 32 | - After completing, send a merge request creating a folder inside the [Keras Assignment](https://github.com/oss2019/text-summarization/tree/master/Framework/Keras/Keras%20Assingment) folder having name as **YourName_Task1**. 33 | - Inside this folder, place your python script along with the training logs either as an image or as a text file, following the naming conventions **YourName_Model.py** and **YourName_Logs.txt** or **YourName_Logs.jpg** or any supported image type respectively. (Anything more you want to add, just prefix it with **YourName_** inside your folder). 34 | -------------------------------------------------------------------------------- /Framework/Keras/Keras Assingment/Task_1/Task1.md: -------------------------------------------------------------------------------- 1 | # MNIST (Modified National Institute of Standards and Technology database) 2 | - Database of handwritten digits(0-9) that is commonly used for training various image classification tasks. 3 | - Contains 60,000 training images and 10,000 testing images each of 28x28 pixel in grayscale. 4 | - Composed by 500 differenct writers including American Census Bureau employees and American high school students. 5 | 6 | ## TASK 7 | - The task is to build a classifier which can classify the set of images into 10 different classes(*categories*) one for each digit. 8 | - Understand and build a classifier in **Keras** having an architecture: 9 | - One hidden layer of size 512 10 | - Output layer of size 10 (*Number of classes*) 11 | - For the input layer, stack all the 28x28 pixels of an image into a vector of size 784 (*Can be done using numpy*) and feed into the model. 12 | 13 | ## PROCESS 14 | ### 1. Dataset preprocessing or structuring 15 | Keras has inbuilt mnist dataset. Can be directly imported and used for making train and test datasets. 16 | ### 2. Designing the model 17 | - Keras providies us with two main types of models: 18 | 1. The Sequential Model 19 | 2. Model class with functional API 20 | - Please find more about the two options from Keras Docs. For this assignment we'll be using sequential model. 21 | - While adding layers to the sequential model, keras also takes as argument the activation function which you would like to use for each layer. Please find more about the available activation functions from [here](https://keras.io/activations/). 22 | ### 3. Compiling the model 23 | Compile in Keras defines the loss function, the optimizer and the metrics for the model training. 24 | Please find the list of available optimizers in keras from [here](https://keras.io/optimizers/). 25 | ### 4. Training the Model 26 | After preparing the dataset and compiling the model, our model now is ready to get trained on the mnist dataset. Keras does all the job of training the model on the dataset using a simple command **fit** which also returns the training history logs. 27 | ### 5. Evaluating the model 28 | Finally, after training the model, we check its performance on the test dataset using the **evaluate** method. 29 | 30 | ## CONTRIBUTING 31 | 32 | - After completing, send a merge request creating a folder inside the [Keras Assignment](https://github.com/oss2019/text-summarization/tree/master/Framework/Keras/Keras%20Assingment) folder having name as **YourName_Task1**. 33 | - Inside this folder, place your python script along with the training logs either as an image or as a text file, following the naming conventions **YourName_Model.py** and **YourName_Logs.txt** or **YourName_Logs.jpg** or any supported image type respectively. (Anything more you want to add, just prefix it with **YourName_** inside your folder). 34 | -------------------------------------------------------------------------------- /Framework/Keras/Keras Assingment/YugalJain_ModelwithLogs.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [ 8 | { 9 | "name": "stderr", 10 | "output_type": "stream", 11 | "text": [ 12 | "C:\\Users\\PC\\Anaconda3\\envs\\python35\\lib\\site-packages\\h5py\\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.\n", 13 | " from ._conv import register_converters as _register_converters\n", 14 | "Using TensorFlow backend.\n" 15 | ] 16 | } 17 | ], 18 | "source": [ 19 | "import keras\n", 20 | "from keras import optimizers\n", 21 | "from keras.models import Sequential\n", 22 | "model=Sequential()\n", 23 | "from keras.datasets import mnist\n", 24 | "(x_train,y_train),(x_test,y_test)=mnist.load_data()\n" 25 | ] 26 | }, 27 | { 28 | "cell_type": "code", 29 | "execution_count": 2, 30 | "metadata": {}, 31 | "outputs": [], 32 | "source": [ 33 | "x_train=keras.utils.normalize(x_train,axis=1)\n", 34 | "x_test=keras.utils.normalize(x_test,axis=1)\n", 35 | "\n", 36 | "\n" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": null, 42 | "metadata": {}, 43 | "outputs": [], 44 | "source": [] 45 | }, 46 | { 47 | "cell_type": "code", 48 | "execution_count": 11, 49 | "metadata": {}, 50 | "outputs": [ 51 | { 52 | "ename": "ValueError", 53 | "evalue": "Error when checking target: expected dense_8 to have shape (10,) but got array with shape (1,)", 54 | "output_type": "error", 55 | "traceback": [ 56 | "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", 57 | "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", 58 | "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 8\u001b[0m metrics=['accuracy'])\n\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 10\u001b[1;33m \u001b[0mmodel\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfit\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx_train\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0my_train\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mepochs\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mbatch_size\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m32\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mverbose\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 11\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", 59 | "\u001b[1;32m~\\Anaconda3\\envs\\python35\\lib\\site-packages\\keras\\engine\\training.py\u001b[0m in \u001b[0;36mfit\u001b[1;34m(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)\u001b[0m\n\u001b[0;32m 950\u001b[0m \u001b[0msample_weight\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0msample_weight\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 951\u001b[0m \u001b[0mclass_weight\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mclass_weight\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 952\u001b[1;33m batch_size=batch_size)\n\u001b[0m\u001b[0;32m 953\u001b[0m \u001b[1;31m# Prepare validation data.\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 954\u001b[0m \u001b[0mdo_validation\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;32mFalse\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", 60 | "\u001b[1;32m~\\Anaconda3\\envs\\python35\\lib\\site-packages\\keras\\engine\\training.py\u001b[0m in \u001b[0;36m_standardize_user_data\u001b[1;34m(self, x, y, sample_weight, class_weight, check_array_lengths, batch_size)\u001b[0m\n\u001b[0;32m 787\u001b[0m \u001b[0mfeed_output_shapes\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 788\u001b[0m \u001b[0mcheck_batch_axis\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mFalse\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;31m# Don't enforce the batch size.\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 789\u001b[1;33m exception_prefix='target')\n\u001b[0m\u001b[0;32m 790\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 791\u001b[0m \u001b[1;31m# Generate sample-wise weight values given the `sample_weight` and\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", 61 | "\u001b[1;32m~\\Anaconda3\\envs\\python35\\lib\\site-packages\\keras\\engine\\training_utils.py\u001b[0m in \u001b[0;36mstandardize_input_data\u001b[1;34m(data, names, shapes, check_batch_axis, exception_prefix)\u001b[0m\n\u001b[0;32m 136\u001b[0m \u001b[1;34m': expected '\u001b[0m \u001b[1;33m+\u001b[0m \u001b[0mnames\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m+\u001b[0m \u001b[1;34m' to have shape '\u001b[0m \u001b[1;33m+\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 137\u001b[0m \u001b[0mstr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m+\u001b[0m \u001b[1;34m' but got array with shape '\u001b[0m \u001b[1;33m+\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 138\u001b[1;33m str(data_shape))\n\u001b[0m\u001b[0;32m 139\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mdata\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 140\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", 62 | "\u001b[1;31mValueError\u001b[0m: Error when checking target: expected dense_8 to have shape (10,) but got array with shape (1,)" 63 | ] 64 | } 65 | ], 66 | "source": [ 67 | "from keras.layers import Dense,Flatten\n", 68 | "model=Sequential()\n", 69 | "model.add(Flatten())\n", 70 | "model.add(Dense(512,activation='relu'))\n", 71 | "model.add(Dense(10,activation='softmax'))\n", 72 | "model.compile(optimizer='rmsprop',\n", 73 | " loss='',\n", 74 | " metrics=['accuracy'])\n", 75 | "\n", 76 | "model.fit(x_train,y_train,epochs=10,batch_size=32,verbose=1)\n", 77 | "\n", 78 | "\n" 79 | ] 80 | }, 81 | { 82 | "cell_type": "code", 83 | "execution_count": null, 84 | "metadata": {}, 85 | "outputs": [], 86 | "source": [] 87 | }, 88 | { 89 | "cell_type": "code", 90 | "execution_count": null, 91 | "metadata": {}, 92 | "outputs": [], 93 | "source": [] 94 | }, 95 | { 96 | "cell_type": "code", 97 | "execution_count": null, 98 | "metadata": {}, 99 | "outputs": [], 100 | "source": [] 101 | }, 102 | { 103 | "cell_type": "code", 104 | "execution_count": null, 105 | "metadata": {}, 106 | "outputs": [], 107 | "source": [] 108 | }, 109 | { 110 | "cell_type": "code", 111 | "execution_count": null, 112 | "metadata": {}, 113 | "outputs": [], 114 | "source": [] 115 | }, 116 | { 117 | "cell_type": "code", 118 | "execution_count": null, 119 | "metadata": {}, 120 | "outputs": [], 121 | "source": [] 122 | }, 123 | { 124 | "cell_type": "code", 125 | "execution_count": null, 126 | "metadata": {}, 127 | "outputs": [], 128 | "source": [] 129 | }, 130 | { 131 | "cell_type": "code", 132 | "execution_count": null, 133 | "metadata": {}, 134 | "outputs": [], 135 | "source": [] 136 | }, 137 | { 138 | "cell_type": "code", 139 | "execution_count": null, 140 | "metadata": {}, 141 | "outputs": [], 142 | "source": [] 143 | }, 144 | { 145 | "cell_type": "code", 146 | "execution_count": null, 147 | "metadata": {}, 148 | "outputs": [], 149 | "source": [] 150 | } 151 | ], 152 | "metadata": { 153 | "kernelspec": { 154 | "display_name": "Python 3", 155 | "language": "python", 156 | "name": "python3" 157 | }, 158 | "language_info": { 159 | "codemirror_mode": { 160 | "name": "ipython", 161 | "version": 3 162 | }, 163 | "file_extension": ".py", 164 | "mimetype": "text/x-python", 165 | "name": "python", 166 | "nbconvert_exporter": "python", 167 | "pygments_lexer": "ipython3", 168 | "version": "3.5.5" 169 | } 170 | }, 171 | "nbformat": 4, 172 | "nbformat_minor": 2 173 | } 174 | -------------------------------------------------------------------------------- /Framework/Keras/Keras Assingment/YugalJain_ModelwithLogs/YugalJain_ModelwithLogs.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "YugalJain_ModelwithLogs.ipynb", 7 | "version": "0.3.2", 8 | "provenance": [], 9 | "collapsed_sections": [] 10 | }, 11 | "language_info": { 12 | "codemirror_mode": { 13 | "name": "ipython", 14 | "version": 3 15 | }, 16 | "file_extension": ".py", 17 | "mimetype": "text/x-python", 18 | "name": "python", 19 | "nbconvert_exporter": "python", 20 | "pygments_lexer": "ipython3", 21 | "version": "3.5.5" 22 | }, 23 | "kernelspec": { 24 | "display_name": "Python 3", 25 | "language": "python", 26 | "name": "python3" 27 | } 28 | }, 29 | "cells": [ 30 | { 31 | "cell_type": "code", 32 | "metadata": { 33 | "id": "FToxEB5V9y6b", 34 | "colab_type": "code", 35 | "colab": { 36 | "base_uri": "https://localhost:8080/", 37 | "height": 34 38 | }, 39 | "outputId": "acf96764-bb8f-48e6-97ef-3dc50522cca0" 40 | }, 41 | "source": [ 42 | "import keras\n", 43 | "from keras import optimizers\n", 44 | "from keras.models import Sequential\n", 45 | "from keras.datasets import mnist\n", 46 | "(x_train,y_train),(x_test,y_test)=mnist.load_data()\n" 47 | ], 48 | "execution_count": 1, 49 | "outputs": [ 50 | { 51 | "output_type": "stream", 52 | "text": [ 53 | "Using TensorFlow backend.\n" 54 | ], 55 | "name": "stderr" 56 | } 57 | ] 58 | }, 59 | { 60 | "cell_type": "code", 61 | "metadata": { 62 | "id": "HxzF9klN9y6v", 63 | "colab_type": "code", 64 | "colab": {} 65 | }, 66 | "source": [ 67 | "# Normalizing input training and testing data\n", 68 | "x_train=keras.utils.normalize(x_train,axis=1)\n", 69 | "x_test=keras.utils.normalize(x_test,axis=1)\n", 70 | "\n" 71 | ], 72 | "execution_count": 0, 73 | "outputs": [] 74 | }, 75 | { 76 | "cell_type": "code", 77 | "metadata": { 78 | "id": "uPZNHmtx9y7K", 79 | "colab_type": "code", 80 | "colab": {} 81 | }, 82 | "source": [ 83 | "" 84 | ], 85 | "execution_count": 0, 86 | "outputs": [] 87 | }, 88 | { 89 | "cell_type": "code", 90 | "metadata": { 91 | "id": "tOeoupjs9y7R", 92 | "colab_type": "code", 93 | "colab": { 94 | "base_uri": "https://localhost:8080/", 95 | "height": 666 96 | }, 97 | "outputId": "8e1596be-196b-427a-9ad6-61ea2978c52a" 98 | }, 99 | "source": [ 100 | "from keras.layers import Dense,Flatten\n", 101 | "# Creating an instance for sequential model\n", 102 | "model=Sequential()\n", 103 | "\n", 104 | "# Adding flatten layer to convert 28*28 pixels into an array of size 784\n", 105 | "model.add(Flatten())\n", 106 | "\n", 107 | "# Adding hidden dense layer of 512 units and relu activation function \n", 108 | "model.add(Dense(512,activation='relu'))\n", 109 | "\n", 110 | "# Adding dense layer of 10 units with softmax activation function\n", 111 | "\n", 112 | "model.add(Dense(10,activation='softmax'))\n", 113 | "\n", 114 | "# Compiling our model with sgd as optimizer\n", 115 | "model.compile(optimizer='sgd',\n", 116 | " loss='sparse_categorical_crossentropy',\n", 117 | " metrics=['accuracy'])\n", 118 | "\n", 119 | "model.fit(x_train,y_train,epochs=10,batch_size=32,verbose=1)\n", 120 | "\n", 121 | "\n" 122 | ], 123 | "execution_count": 4, 124 | "outputs": [ 125 | { 126 | "output_type": "stream", 127 | "text": [ 128 | "WARNING: Logging before flag parsing goes to stderr.\n", 129 | "W0713 11:02:35.218778 140436485834624 deprecation_wrapper.py:119] From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:74: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.\n", 130 | "\n", 131 | "W0713 11:02:35.246967 140436485834624 deprecation_wrapper.py:119] From /usr/local/lib/python3.6/dist-packages/keras/optimizers.py:790: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.\n", 132 | "\n", 133 | "W0713 11:02:35.268220 140436485834624 deprecation_wrapper.py:119] From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.\n", 134 | "\n", 135 | "W0713 11:02:35.281612 140436485834624 deprecation_wrapper.py:119] From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.\n", 136 | "\n", 137 | "W0713 11:02:35.316654 140436485834624 deprecation_wrapper.py:119] From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:3341: The name tf.log is deprecated. Please use tf.math.log instead.\n", 138 | "\n", 139 | "W0713 11:02:35.408233 140436485834624 deprecation.py:323] From /usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/math_grad.py:1250: add_dispatch_support..wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.\n", 140 | "Instructions for updating:\n", 141 | "Use tf.where in 2.0, which has the same broadcast rule as np.where\n", 142 | "W0713 11:02:35.438150 140436485834624 deprecation_wrapper.py:119] From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:986: The name tf.assign_add is deprecated. Please use tf.compat.v1.assign_add instead.\n", 143 | "\n" 144 | ], 145 | "name": "stderr" 146 | }, 147 | { 148 | "output_type": "stream", 149 | "text": [ 150 | "Epoch 1/10\n", 151 | "60000/60000 [==============================] - 11s 183us/step - loss: 1.0670 - acc: 0.7842\n", 152 | "Epoch 2/10\n", 153 | "60000/60000 [==============================] - 10s 174us/step - loss: 0.4594 - acc: 0.8799\n", 154 | "Epoch 3/10\n", 155 | "60000/60000 [==============================] - 10s 171us/step - loss: 0.3753 - acc: 0.8968\n", 156 | "Epoch 4/10\n", 157 | "60000/60000 [==============================] - 10s 169us/step - loss: 0.3370 - acc: 0.9049\n", 158 | "Epoch 5/10\n", 159 | "60000/60000 [==============================] - 11s 179us/step - loss: 0.3123 - acc: 0.9118\n", 160 | "Epoch 6/10\n", 161 | "60000/60000 [==============================] - 11s 177us/step - loss: 0.2939 - acc: 0.9176\n", 162 | "Epoch 7/10\n", 163 | "60000/60000 [==============================] - 10s 172us/step - loss: 0.2789 - acc: 0.9222\n", 164 | "Epoch 8/10\n", 165 | "60000/60000 [==============================] - 10s 171us/step - loss: 0.2658 - acc: 0.9258\n", 166 | "Epoch 9/10\n", 167 | "60000/60000 [==============================] - 11s 176us/step - loss: 0.2545 - acc: 0.9286\n", 168 | "Epoch 10/10\n", 169 | "60000/60000 [==============================] - 11s 176us/step - loss: 0.2442 - acc: 0.9315\n" 170 | ], 171 | "name": "stdout" 172 | }, 173 | { 174 | "output_type": "execute_result", 175 | "data": { 176 | "text/plain": [ 177 | "" 178 | ] 179 | }, 180 | "metadata": { 181 | "tags": [] 182 | }, 183 | "execution_count": 4 184 | } 185 | ] 186 | }, 187 | { 188 | "cell_type": "code", 189 | "metadata": { 190 | "id": "Gcdf7QL69y7g", 191 | "colab_type": "code", 192 | "colab": { 193 | "base_uri": "https://localhost:8080/", 194 | "height": 68 195 | }, 196 | "outputId": "cad2aee7-ea1a-4d7d-95cb-ee3389d06be1" 197 | }, 198 | "source": [ 199 | "#Evaluating the model on test dataset\n", 200 | "loss, acc = model.evaluate(x_test, y_test)\n", 201 | "print(\"Loss: \" + str(loss))\n", 202 | "print(\"Accuarcy: \" + str(100*acc) + \"%\")" 203 | ], 204 | "execution_count": 6, 205 | "outputs": [ 206 | { 207 | "output_type": "stream", 208 | "text": [ 209 | "10000/10000 [==============================] - 1s 61us/step\n", 210 | "Loss: 0.23936950590610503\n", 211 | "Accuarcy: 93.24%\n" 212 | ], 213 | "name": "stdout" 214 | } 215 | ] 216 | }, 217 | { 218 | "cell_type": "code", 219 | "metadata": { 220 | "id": "4EzjH1Cc9y7q", 221 | "colab_type": "code", 222 | "colab": {} 223 | }, 224 | "source": [ 225 | "" 226 | ], 227 | "execution_count": 0, 228 | "outputs": [] 229 | }, 230 | { 231 | "cell_type": "code", 232 | "metadata": { 233 | "id": "sRPmEoDz9y72", 234 | "colab_type": "code", 235 | "colab": {} 236 | }, 237 | "source": [ 238 | "" 239 | ], 240 | "execution_count": 0, 241 | "outputs": [] 242 | }, 243 | { 244 | "cell_type": "code", 245 | "metadata": { 246 | "id": "tEWCSqMO9y7-", 247 | "colab_type": "code", 248 | "colab": {} 249 | }, 250 | "source": [ 251 | "" 252 | ], 253 | "execution_count": 0, 254 | "outputs": [] 255 | }, 256 | { 257 | "cell_type": "code", 258 | "metadata": { 259 | "id": "gkwcYtzo9y8J", 260 | "colab_type": "code", 261 | "colab": {} 262 | }, 263 | "source": [ 264 | "" 265 | ], 266 | "execution_count": 0, 267 | "outputs": [] 268 | }, 269 | { 270 | "cell_type": "code", 271 | "metadata": { 272 | "id": "Po1HrIxd9y8Y", 273 | "colab_type": "code", 274 | "colab": {} 275 | }, 276 | "source": [ 277 | "" 278 | ], 279 | "execution_count": 0, 280 | "outputs": [] 281 | }, 282 | { 283 | "cell_type": "code", 284 | "metadata": { 285 | "id": "1LA6Q5GT9y8k", 286 | "colab_type": "code", 287 | "colab": {} 288 | }, 289 | "source": [ 290 | "" 291 | ], 292 | "execution_count": 0, 293 | "outputs": [] 294 | }, 295 | { 296 | "cell_type": "code", 297 | "metadata": { 298 | "id": "grys8Ui19y81", 299 | "colab_type": "code", 300 | "colab": {} 301 | }, 302 | "source": [ 303 | "" 304 | ], 305 | "execution_count": 0, 306 | "outputs": [] 307 | }, 308 | { 309 | "cell_type": "code", 310 | "metadata": { 311 | "id": "nHRTV2409y89", 312 | "colab_type": "code", 313 | "colab": {} 314 | }, 315 | "source": [ 316 | "" 317 | ], 318 | "execution_count": 0, 319 | "outputs": [] 320 | }, 321 | { 322 | "cell_type": "code", 323 | "metadata": { 324 | "id": "UjHaC1Wh9y9J", 325 | "colab_type": "code", 326 | "colab": {} 327 | }, 328 | "source": [ 329 | "" 330 | ], 331 | "execution_count": 0, 332 | "outputs": [] 333 | } 334 | ] 335 | } 336 | -------------------------------------------------------------------------------- /Framework/Keras/README.md: -------------------------------------------------------------------------------- 1 | # Text Summarization-Python Keras 2 | 3 | Hey Everyone! So we ran our test about right and here we show you a glimpse of how text summarization using deep learning is going to be like. 4 | We used a basic seq2seq model and a pretty concise dataset to generate our summmaries, it might not be as great as human level but it sure works! 5 | 6 | After training on the amazon reviews dataset, 7 | Here goes--- 8 | ## Review #1 9 | These are sooooo good! Addictive. Just know they're not CARROT chips/fries (actual fried carrot slices) they're carrot CHIPS - think POTATO chips (actual fried potato) vs corn CHIPS (cornmeal fried chip, basically). Trying to use inflection for emphasis there. Either you love or hate but my entire family craves these! 10 | 11 | ### Original Summary #1 12 | > Love These! 13 | 14 | ### Generated Summary #1 15 | > love these chips 16 | 17 | Cool right! The model is able to recognize the fact that the main topic of discussion in the entire review was about chips. 18 | This model is still in its basic stages and lots of improvements can be built upon this. 19 | 20 | This deep learning model was built in a framework known as keras with tensorflow backend. Now for all those who have done the courses of Deep Learning would have definetely heard of these names. 21 | 22 | Before we dive into the text summarization we wanted to give you a decent idea of how to work with these frameworks 23 | 24 | Please follow these instructions carefully:(You need to get this right) 25 | - We will be mainly focuing on Linux based OS. 26 | - Since we do not want to disrupt various versions of various python packages in your system, we would be running all your scripts on a python virtual environment. (its also considered good practice!) 27 | - For all those who do not know what is a python virtual environment and how to work on it, well virtual environment as the name suggests is like a virtual world where you can install particular versions of all your dependecies for a project without actually changing your system configurations. 28 | - This also makes sure that none of you will run into version troubles while executing your scripts. 29 | - To install and use python virtual environment, just have a look at this [link]( 30 | https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/). 31 | - Please do create a virtual environment with **python3**.Also, after creating your venv please verify your python version using the command: 32 | `python --version` 33 | 34 | - Once you have activated your virtual environment, to get working with Keras install the following: 35 | - pip install bs4 36 | - pip install matplotlib 37 | - pip install h5py 38 | - pip install sklearn 39 | - pip install numpy 40 | - pip install tensorflow==1.14.0 41 | - pip install keras==2.2.4 42 | - pip install pandas 43 | - pip install nltk 44 | - pip install lxml 45 | -------------------------------------------------------------------------------- /Framework/README.md: -------------------------------------------------------------------------------- 1 | Find all the details about the framework we'll be using to build our text-summarizer [here](https://github.com/oss2019/text-summarization/blob/master/Framework/Keras/README.md) and also **TASK1** is up! 2 | Please find the complete details about the problem statement [here](https://github.com/oss2019/text-summarization/blob/master/Framework/Keras/Keras%20Assingment/Task_1/Task1.md)! 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 OSS 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Phase 1/Numpy_Pandas/Introduction to Pandas.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "


\n", 8 | "Pandas


\n", 9 | "\n", 10 | "*pandas* is a Python library for data analysis. It offers a number of data exploration, cleaning and transformation operations that are critical in working with data in Python. \n", 11 | "\n", 12 | "*pandas* build upon *numpy* and *scipy* providing easy-to-use data structures and data manipulation functions with integrated indexing.\n", 13 | "\n", 14 | "The main data structures *pandas* provides are *Series* and *DataFrames*. After a brief introduction to these two data structures and data ingestion, the key features of *pandas* this notebook covers are:\n", 15 | "* Generating descriptive statistics on data\n", 16 | "* Data cleaning using built in pandas functions\n", 17 | "* Frequent data operations for subsetting, filtering, insertion, deletion and aggregation of data\n", 18 | "* Merging multiple datasets using dataframes\n", 19 | "* Working with timestamps and time-series data\n", 20 | "\n", 21 | "Let's get started with our first *pandas* notebook!" 22 | ] 23 | }, 24 | { 25 | "cell_type": "markdown", 26 | "metadata": {}, 27 | "source": [ 28 | "


\n", 29 | "\n", 30 | "Import Libraries\n", 31 | "

" 32 | ] 33 | }, 34 | { 35 | "cell_type": "code", 36 | "execution_count": null, 37 | "metadata": {}, 38 | "outputs": [], 39 | "source": [ 40 | "import pandas as pd" 41 | ] 42 | }, 43 | { 44 | "cell_type": "markdown", 45 | "metadata": {}, 46 | "source": [ 47 | "

\n", 48 | "Introduction to pandas Data Structures

\n", 49 | "
\n", 50 | "*pandas* has two main data structures it uses, namely, *Series* and *DataFrames*. \n", 51 | "\n", 52 | "

\n", 53 | "pandas Series

\n", 54 | "\n", 55 | "*pandas Series* one-dimensional labeled array. \n" 56 | ] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": null, 61 | "metadata": {}, 62 | "outputs": [], 63 | "source": [ 64 | "ser = pd.Series([100, 'foo', 300, 'bar', 500], ['tom', 'bob', 'nancy', 'dan', 'eric'])" 65 | ] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "execution_count": null, 70 | "metadata": {}, 71 | "outputs": [], 72 | "source": [ 73 | "ser" 74 | ] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "execution_count": null, 79 | "metadata": {}, 80 | "outputs": [], 81 | "source": [ 82 | "ser.index" 83 | ] 84 | }, 85 | { 86 | "cell_type": "code", 87 | "execution_count": null, 88 | "metadata": {}, 89 | "outputs": [], 90 | "source": [ 91 | "ser.loc[['nancy','bob']]" 92 | ] 93 | }, 94 | { 95 | "cell_type": "code", 96 | "execution_count": null, 97 | "metadata": {}, 98 | "outputs": [], 99 | "source": [ 100 | "ser[[4, 3, 1]]" 101 | ] 102 | }, 103 | { 104 | "cell_type": "code", 105 | "execution_count": null, 106 | "metadata": {}, 107 | "outputs": [], 108 | "source": [ 109 | "ser.iloc[2]" 110 | ] 111 | }, 112 | { 113 | "cell_type": "code", 114 | "execution_count": null, 115 | "metadata": {}, 116 | "outputs": [], 117 | "source": [ 118 | "'bob' in ser" 119 | ] 120 | }, 121 | { 122 | "cell_type": "code", 123 | "execution_count": null, 124 | "metadata": {}, 125 | "outputs": [], 126 | "source": [ 127 | "ser" 128 | ] 129 | }, 130 | { 131 | "cell_type": "code", 132 | "execution_count": null, 133 | "metadata": {}, 134 | "outputs": [], 135 | "source": [ 136 | "ser * 2" 137 | ] 138 | }, 139 | { 140 | "cell_type": "code", 141 | "execution_count": null, 142 | "metadata": {}, 143 | "outputs": [], 144 | "source": [ 145 | "ser[['nancy', 'eric']] ** 2" 146 | ] 147 | }, 148 | { 149 | "cell_type": "markdown", 150 | "metadata": {}, 151 | "source": [ 152 | "

\n", 153 | "pandas DataFrame

\n", 154 | "\n", 155 | "*pandas DataFrame* is a 2-dimensional labeled data structure." 156 | ] 157 | }, 158 | { 159 | "cell_type": "markdown", 160 | "metadata": {}, 161 | "source": [ 162 | "

\n", 163 | "Create DataFrame from dictionary of Python Series

" 164 | ] 165 | }, 166 | { 167 | "cell_type": "code", 168 | "execution_count": null, 169 | "metadata": { 170 | "collapsed": true 171 | }, 172 | "outputs": [], 173 | "source": [ 174 | "d = {'one' : pd.Series([100., 200., 300.], index=['apple', 'ball', 'clock']),\n", 175 | " 'two' : pd.Series([111., 222., 333., 4444.], index=['apple', 'ball', 'cerill', 'dancy'])}" 176 | ] 177 | }, 178 | { 179 | "cell_type": "code", 180 | "execution_count": null, 181 | "metadata": {}, 182 | "outputs": [], 183 | "source": [ 184 | "df = pd.DataFrame(d)\n", 185 | "print(df)" 186 | ] 187 | }, 188 | { 189 | "cell_type": "code", 190 | "execution_count": null, 191 | "metadata": {}, 192 | "outputs": [], 193 | "source": [ 194 | "df.index" 195 | ] 196 | }, 197 | { 198 | "cell_type": "code", 199 | "execution_count": null, 200 | "metadata": {}, 201 | "outputs": [], 202 | "source": [ 203 | "df.columns" 204 | ] 205 | }, 206 | { 207 | "cell_type": "code", 208 | "execution_count": null, 209 | "metadata": {}, 210 | "outputs": [], 211 | "source": [ 212 | "pd.DataFrame(d, index=['dancy', 'ball', 'apple'])" 213 | ] 214 | }, 215 | { 216 | "cell_type": "code", 217 | "execution_count": null, 218 | "metadata": {}, 219 | "outputs": [], 220 | "source": [ 221 | "pd.DataFrame(d, index=['dancy', 'ball', 'apple'], columns=['two', 'five'])" 222 | ] 223 | }, 224 | { 225 | "cell_type": "markdown", 226 | "metadata": {}, 227 | "source": [ 228 | "

\n", 229 | "Create DataFrame from list of Python dictionaries

" 230 | ] 231 | }, 232 | { 233 | "cell_type": "code", 234 | "execution_count": null, 235 | "metadata": { 236 | "collapsed": true 237 | }, 238 | "outputs": [], 239 | "source": [ 240 | "data = [{'alex': 1, 'joe': 2}, {'ema': 5, 'dora': 10, 'alice': 20}]" 241 | ] 242 | }, 243 | { 244 | "cell_type": "code", 245 | "execution_count": null, 246 | "metadata": {}, 247 | "outputs": [], 248 | "source": [ 249 | "pd.DataFrame(data)" 250 | ] 251 | }, 252 | { 253 | "cell_type": "code", 254 | "execution_count": null, 255 | "metadata": {}, 256 | "outputs": [], 257 | "source": [ 258 | "pd.DataFrame(data, index=['orange', 'red'])" 259 | ] 260 | }, 261 | { 262 | "cell_type": "code", 263 | "execution_count": null, 264 | "metadata": {}, 265 | "outputs": [], 266 | "source": [ 267 | "pd.DataFrame(data, columns=['joe', 'dora','alice'])" 268 | ] 269 | }, 270 | { 271 | "cell_type": "markdown", 272 | "metadata": {}, 273 | "source": [ 274 | "

\n", 275 | "Basic DataFrame operations

" 276 | ] 277 | }, 278 | { 279 | "cell_type": "code", 280 | "execution_count": null, 281 | "metadata": {}, 282 | "outputs": [], 283 | "source": [ 284 | "df" 285 | ] 286 | }, 287 | { 288 | "cell_type": "code", 289 | "execution_count": null, 290 | "metadata": {}, 291 | "outputs": [], 292 | "source": [ 293 | "df['one']" 294 | ] 295 | }, 296 | { 297 | "cell_type": "code", 298 | "execution_count": null, 299 | "metadata": {}, 300 | "outputs": [], 301 | "source": [ 302 | "df['three'] = df['one'] * df['two']\n", 303 | "df" 304 | ] 305 | }, 306 | { 307 | "cell_type": "code", 308 | "execution_count": null, 309 | "metadata": {}, 310 | "outputs": [], 311 | "source": [ 312 | "df['flag'] = df['one'] > 250\n", 313 | "df" 314 | ] 315 | }, 316 | { 317 | "cell_type": "code", 318 | "execution_count": null, 319 | "metadata": { 320 | "collapsed": true 321 | }, 322 | "outputs": [], 323 | "source": [ 324 | "three = df.pop('three')" 325 | ] 326 | }, 327 | { 328 | "cell_type": "code", 329 | "execution_count": null, 330 | "metadata": {}, 331 | "outputs": [], 332 | "source": [ 333 | "three" 334 | ] 335 | }, 336 | { 337 | "cell_type": "code", 338 | "execution_count": null, 339 | "metadata": {}, 340 | "outputs": [], 341 | "source": [ 342 | "df" 343 | ] 344 | }, 345 | { 346 | "cell_type": "code", 347 | "execution_count": null, 348 | "metadata": { 349 | "collapsed": true 350 | }, 351 | "outputs": [], 352 | "source": [ 353 | "del df['two']" 354 | ] 355 | }, 356 | { 357 | "cell_type": "code", 358 | "execution_count": null, 359 | "metadata": {}, 360 | "outputs": [], 361 | "source": [ 362 | "df" 363 | ] 364 | }, 365 | { 366 | "cell_type": "code", 367 | "execution_count": null, 368 | "metadata": {}, 369 | "outputs": [], 370 | "source": [ 371 | "df.insert(2, 'copy_of_one', df['one'])\n", 372 | "df" 373 | ] 374 | }, 375 | { 376 | "cell_type": "code", 377 | "execution_count": null, 378 | "metadata": {}, 379 | "outputs": [], 380 | "source": [ 381 | "df['one_upper_half'] = df['one'][:2]\n", 382 | "df" 383 | ] 384 | }, 385 | { 386 | "cell_type": "markdown", 387 | "metadata": {}, 388 | "source": [ 389 | "

\n", 390 | "Case Study: Movie Data Analysis

\n", 391 | "
This notebook uses a dataset from the MovieLens website. We will describe the dataset further as we explore with it using *pandas*. \n", 392 | "\n", 393 | "## Download the Dataset\n", 394 | "\n", 395 | "Please note that **you will need to download the dataset**. Although the video for this notebook says that the data is in your folder, the folder turned out to be too large to fit on the edX platform due to size constraints.\n", 396 | "\n", 397 | "Here are the links to the data source and location:\n", 398 | "* **Data Source:** MovieLens web site (filename: ml-20m.zip)\n", 399 | "* **Location:** https://grouplens.org/datasets/movielens/\n", 400 | "\n", 401 | "Once the download completes, please make sure the data files are in a directory called *movielens*. \n", 402 | "\n" 403 | ] 404 | }, 405 | { 406 | "cell_type": "markdown", 407 | "metadata": {}, 408 | "source": [ 409 | "

\n", 410 | "Use Pandas to Read the Dataset
\n", 411 | "

\n", 412 | "
\n", 413 | "In this notebook, we will be using three CSV files:\n", 414 | "* **ratings.csv :** *userId*,*movieId*,*rating*, *timestamp*\n", 415 | "* **tags.csv :** *userId*,*movieId*, *tag*, *timestamp*\n", 416 | "* **movies.csv :** *movieId*, *title*, *genres*
\n", 417 | "\n", 418 | "Using the *read_csv* function in pandas, we will ingest these three files." 419 | ] 420 | }, 421 | { 422 | "cell_type": "code", 423 | "execution_count": null, 424 | "metadata": {}, 425 | "outputs": [], 426 | "source": [ 427 | "movies = pd.read_csv('./movielens/movies.csv', sep=',')\n", 428 | "print(type(movies))\n", 429 | "movies.head(15)" 430 | ] 431 | }, 432 | { 433 | "cell_type": "code", 434 | "execution_count": null, 435 | "metadata": {}, 436 | "outputs": [], 437 | "source": [ 438 | "# Timestamps represent seconds since midnight Coordinated Universal Time (UTC) of January 1, 1970\n", 439 | "\n", 440 | "tags = pd.read_csv('./movielens/tags.csv', sep=',')\n", 441 | "tags.head()" 442 | ] 443 | }, 444 | { 445 | "cell_type": "code", 446 | "execution_count": null, 447 | "metadata": {}, 448 | "outputs": [], 449 | "source": [ 450 | "ratings = pd.read_csv('./movielens/ratings.csv', sep=',', parse_dates=['timestamp'])\n", 451 | "ratings.head()" 452 | ] 453 | }, 454 | { 455 | "cell_type": "code", 456 | "execution_count": null, 457 | "metadata": {}, 458 | "outputs": [], 459 | "source": [ 460 | "# For current analysis, we will remove timestamp (we will come back to it!)\n", 461 | "\n", 462 | "del ratings['timestamp']\n", 463 | "del tags['timestamp']" 464 | ] 465 | }, 466 | { 467 | "cell_type": "markdown", 468 | "metadata": {}, 469 | "source": [ 470 | "

Data Structures

" 471 | ] 472 | }, 473 | { 474 | "cell_type": "markdown", 475 | "metadata": {}, 476 | "source": [ 477 | "

Series

" 478 | ] 479 | }, 480 | { 481 | "cell_type": "code", 482 | "execution_count": null, 483 | "metadata": {}, 484 | "outputs": [], 485 | "source": [ 486 | "#Extract 0th row: notice that it is infact a Series\n", 487 | "\n", 488 | "row_0 = tags.iloc[0]\n", 489 | "type(row_0)" 490 | ] 491 | }, 492 | { 493 | "cell_type": "code", 494 | "execution_count": null, 495 | "metadata": {}, 496 | "outputs": [], 497 | "source": [ 498 | "print(row_0)" 499 | ] 500 | }, 501 | { 502 | "cell_type": "code", 503 | "execution_count": null, 504 | "metadata": {}, 505 | "outputs": [], 506 | "source": [ 507 | "row_0.index" 508 | ] 509 | }, 510 | { 511 | "cell_type": "code", 512 | "execution_count": null, 513 | "metadata": {}, 514 | "outputs": [], 515 | "source": [ 516 | "row_0['userId']" 517 | ] 518 | }, 519 | { 520 | "cell_type": "code", 521 | "execution_count": null, 522 | "metadata": {}, 523 | "outputs": [], 524 | "source": [ 525 | "'rating' in row_0" 526 | ] 527 | }, 528 | { 529 | "cell_type": "code", 530 | "execution_count": null, 531 | "metadata": {}, 532 | "outputs": [], 533 | "source": [ 534 | "row_0.name" 535 | ] 536 | }, 537 | { 538 | "cell_type": "code", 539 | "execution_count": null, 540 | "metadata": {}, 541 | "outputs": [], 542 | "source": [ 543 | "row_0 = row_0.rename('first_row')\n", 544 | "row_0.name" 545 | ] 546 | }, 547 | { 548 | "cell_type": "markdown", 549 | "metadata": {}, 550 | "source": [ 551 | "

DataFrames

" 552 | ] 553 | }, 554 | { 555 | "cell_type": "code", 556 | "execution_count": null, 557 | "metadata": {}, 558 | "outputs": [], 559 | "source": [ 560 | "tags.head()" 561 | ] 562 | }, 563 | { 564 | "cell_type": "code", 565 | "execution_count": null, 566 | "metadata": {}, 567 | "outputs": [], 568 | "source": [ 569 | "tags.index" 570 | ] 571 | }, 572 | { 573 | "cell_type": "code", 574 | "execution_count": null, 575 | "metadata": {}, 576 | "outputs": [], 577 | "source": [ 578 | "tags.columns" 579 | ] 580 | }, 581 | { 582 | "cell_type": "code", 583 | "execution_count": null, 584 | "metadata": {}, 585 | "outputs": [], 586 | "source": [ 587 | "# Extract row 0, 11, 2000 from DataFrame\n", 588 | "\n", 589 | "tags.iloc[ [0,11,2000] ]" 590 | ] 591 | }, 592 | { 593 | "cell_type": "markdown", 594 | "metadata": {}, 595 | "source": [ 596 | "

Descriptive Statistics

\n", 597 | "\n", 598 | "Let's look how the ratings are distributed! " 599 | ] 600 | }, 601 | { 602 | "cell_type": "code", 603 | "execution_count": null, 604 | "metadata": {}, 605 | "outputs": [], 606 | "source": [ 607 | "ratings['rating'].describe()" 608 | ] 609 | }, 610 | { 611 | "cell_type": "code", 612 | "execution_count": null, 613 | "metadata": {}, 614 | "outputs": [], 615 | "source": [ 616 | "ratings.describe()" 617 | ] 618 | }, 619 | { 620 | "cell_type": "code", 621 | "execution_count": null, 622 | "metadata": {}, 623 | "outputs": [], 624 | "source": [ 625 | "ratings['rating'].mean()" 626 | ] 627 | }, 628 | { 629 | "cell_type": "code", 630 | "execution_count": null, 631 | "metadata": {}, 632 | "outputs": [], 633 | "source": [ 634 | "ratings.mean()" 635 | ] 636 | }, 637 | { 638 | "cell_type": "code", 639 | "execution_count": null, 640 | "metadata": {}, 641 | "outputs": [], 642 | "source": [ 643 | "ratings['rating'].min()" 644 | ] 645 | }, 646 | { 647 | "cell_type": "code", 648 | "execution_count": null, 649 | "metadata": {}, 650 | "outputs": [], 651 | "source": [ 652 | "ratings['rating'].max()" 653 | ] 654 | }, 655 | { 656 | "cell_type": "code", 657 | "execution_count": null, 658 | "metadata": {}, 659 | "outputs": [], 660 | "source": [ 661 | "ratings['rating'].std()" 662 | ] 663 | }, 664 | { 665 | "cell_type": "code", 666 | "execution_count": null, 667 | "metadata": {}, 668 | "outputs": [], 669 | "source": [ 670 | "ratings['rating'].mode()" 671 | ] 672 | }, 673 | { 674 | "cell_type": "code", 675 | "execution_count": null, 676 | "metadata": { 677 | "scrolled": true 678 | }, 679 | "outputs": [], 680 | "source": [ 681 | "ratings.corr()" 682 | ] 683 | }, 684 | { 685 | "cell_type": "code", 686 | "execution_count": null, 687 | "metadata": {}, 688 | "outputs": [], 689 | "source": [ 690 | "filter_1 = ratings['rating'] > 5\n", 691 | "print(filter_1)\n", 692 | "filter_1.any()" 693 | ] 694 | }, 695 | { 696 | "cell_type": "code", 697 | "execution_count": null, 698 | "metadata": {}, 699 | "outputs": [], 700 | "source": [ 701 | "filter_2 = ratings['rating'] > 0\n", 702 | "filter_2.all()" 703 | ] 704 | }, 705 | { 706 | "cell_type": "markdown", 707 | "metadata": {}, 708 | "source": [ 709 | "

Data Cleaning: Handling Missing Data

" 710 | ] 711 | }, 712 | { 713 | "cell_type": "code", 714 | "execution_count": null, 715 | "metadata": {}, 716 | "outputs": [], 717 | "source": [ 718 | "movies.shape" 719 | ] 720 | }, 721 | { 722 | "cell_type": "code", 723 | "execution_count": null, 724 | "metadata": {}, 725 | "outputs": [], 726 | "source": [ 727 | "#is any row NULL ?\n", 728 | "\n", 729 | "movies.isnull().any()" 730 | ] 731 | }, 732 | { 733 | "cell_type": "markdown", 734 | "metadata": { 735 | "collapsed": true 736 | }, 737 | "source": [ 738 | "Thats nice ! No NULL values !" 739 | ] 740 | }, 741 | { 742 | "cell_type": "code", 743 | "execution_count": null, 744 | "metadata": {}, 745 | "outputs": [], 746 | "source": [ 747 | "ratings.shape" 748 | ] 749 | }, 750 | { 751 | "cell_type": "code", 752 | "execution_count": null, 753 | "metadata": {}, 754 | "outputs": [], 755 | "source": [ 756 | "#is any row NULL ?\n", 757 | "\n", 758 | "ratings.isnull().any()" 759 | ] 760 | }, 761 | { 762 | "cell_type": "markdown", 763 | "metadata": { 764 | "collapsed": true 765 | }, 766 | "source": [ 767 | "Thats nice ! No NULL values !" 768 | ] 769 | }, 770 | { 771 | "cell_type": "code", 772 | "execution_count": null, 773 | "metadata": {}, 774 | "outputs": [], 775 | "source": [ 776 | "tags.shape" 777 | ] 778 | }, 779 | { 780 | "cell_type": "code", 781 | "execution_count": null, 782 | "metadata": {}, 783 | "outputs": [], 784 | "source": [ 785 | "#is any row NULL ?\n", 786 | "\n", 787 | "tags.isnull().any()" 788 | ] 789 | }, 790 | { 791 | "cell_type": "markdown", 792 | "metadata": { 793 | "collapsed": true 794 | }, 795 | "source": [ 796 | "We have some tags which are NULL." 797 | ] 798 | }, 799 | { 800 | "cell_type": "code", 801 | "execution_count": null, 802 | "metadata": { 803 | "collapsed": true 804 | }, 805 | "outputs": [], 806 | "source": [ 807 | "tags = tags.dropna()" 808 | ] 809 | }, 810 | { 811 | "cell_type": "code", 812 | "execution_count": null, 813 | "metadata": {}, 814 | "outputs": [], 815 | "source": [ 816 | "#Check again: is any row NULL ?\n", 817 | "\n", 818 | "tags.isnull().any()" 819 | ] 820 | }, 821 | { 822 | "cell_type": "code", 823 | "execution_count": null, 824 | "metadata": {}, 825 | "outputs": [], 826 | "source": [ 827 | "tags.shape" 828 | ] 829 | }, 830 | { 831 | "cell_type": "markdown", 832 | "metadata": { 833 | "collapsed": true 834 | }, 835 | "source": [ 836 | "Thats nice ! No NULL values ! Notice the number of lines have reduced." 837 | ] 838 | }, 839 | { 840 | "cell_type": "markdown", 841 | "metadata": {}, 842 | "source": [ 843 | "

Data Visualization

" 844 | ] 845 | }, 846 | { 847 | "cell_type": "code", 848 | "execution_count": null, 849 | "metadata": {}, 850 | "outputs": [], 851 | "source": [ 852 | "%matplotlib inline\n", 853 | "\n", 854 | "ratings.hist(column='rating', figsize=(15,10))" 855 | ] 856 | }, 857 | { 858 | "cell_type": "code", 859 | "execution_count": null, 860 | "metadata": {}, 861 | "outputs": [], 862 | "source": [ 863 | "ratings.boxplot(column='rating', figsize=(15,20))" 864 | ] 865 | }, 866 | { 867 | "cell_type": "markdown", 868 | "metadata": {}, 869 | "source": [ 870 | "

Slicing Out Columns

\n", 871 | " " 872 | ] 873 | }, 874 | { 875 | "cell_type": "code", 876 | "execution_count": null, 877 | "metadata": {}, 878 | "outputs": [], 879 | "source": [ 880 | "tags['tag'].head()" 881 | ] 882 | }, 883 | { 884 | "cell_type": "code", 885 | "execution_count": null, 886 | "metadata": {}, 887 | "outputs": [], 888 | "source": [ 889 | "movies[['title','genres']].head()" 890 | ] 891 | }, 892 | { 893 | "cell_type": "code", 894 | "execution_count": null, 895 | "metadata": {}, 896 | "outputs": [], 897 | "source": [ 898 | "ratings[-10:]" 899 | ] 900 | }, 901 | { 902 | "cell_type": "code", 903 | "execution_count": null, 904 | "metadata": {}, 905 | "outputs": [], 906 | "source": [ 907 | "tag_counts = tags['tag'].value_counts()\n", 908 | "tag_counts[-10:]" 909 | ] 910 | }, 911 | { 912 | "cell_type": "code", 913 | "execution_count": null, 914 | "metadata": {}, 915 | "outputs": [], 916 | "source": [ 917 | "tag_counts[:10].plot(kind='bar', figsize=(15,10))" 918 | ] 919 | }, 920 | { 921 | "cell_type": "markdown", 922 | "metadata": {}, 923 | "source": [ 924 | "

Filters for Selecting Rows

" 925 | ] 926 | }, 927 | { 928 | "cell_type": "code", 929 | "execution_count": null, 930 | "metadata": {}, 931 | "outputs": [], 932 | "source": [ 933 | "is_highly_rated = ratings['rating'] >= 4.0\n", 934 | "\n", 935 | "ratings[is_highly_rated][30:50]" 936 | ] 937 | }, 938 | { 939 | "cell_type": "code", 940 | "execution_count": null, 941 | "metadata": {}, 942 | "outputs": [], 943 | "source": [ 944 | "is_animation = movies['genres'].str.contains('Animation')\n", 945 | "\n", 946 | "movies[is_animation][5:15]" 947 | ] 948 | }, 949 | { 950 | "cell_type": "code", 951 | "execution_count": null, 952 | "metadata": {}, 953 | "outputs": [], 954 | "source": [ 955 | "movies[is_animation].head(15)" 956 | ] 957 | }, 958 | { 959 | "cell_type": "markdown", 960 | "metadata": {}, 961 | "source": [ 962 | "

Group By and Aggregate

" 963 | ] 964 | }, 965 | { 966 | "cell_type": "code", 967 | "execution_count": null, 968 | "metadata": {}, 969 | "outputs": [], 970 | "source": [ 971 | "ratings_count = ratings[['movieId','rating']].groupby('rating').count()\n", 972 | "ratings_count" 973 | ] 974 | }, 975 | { 976 | "cell_type": "code", 977 | "execution_count": null, 978 | "metadata": {}, 979 | "outputs": [], 980 | "source": [ 981 | "average_rating = ratings[['movieId','rating']].groupby('movieId').mean()\n", 982 | "average_rating.head()" 983 | ] 984 | }, 985 | { 986 | "cell_type": "code", 987 | "execution_count": null, 988 | "metadata": {}, 989 | "outputs": [], 990 | "source": [ 991 | "movie_count = ratings[['movieId','rating']].groupby('movieId').count()\n", 992 | "movie_count.head()" 993 | ] 994 | }, 995 | { 996 | "cell_type": "code", 997 | "execution_count": null, 998 | "metadata": {}, 999 | "outputs": [], 1000 | "source": [ 1001 | "movie_count = ratings[['movieId','rating']].groupby('movieId').count()\n", 1002 | "movie_count.tail()" 1003 | ] 1004 | }, 1005 | { 1006 | "cell_type": "markdown", 1007 | "metadata": {}, 1008 | "source": [ 1009 | "

Merge Dataframes

" 1010 | ] 1011 | }, 1012 | { 1013 | "cell_type": "code", 1014 | "execution_count": null, 1015 | "metadata": {}, 1016 | "outputs": [], 1017 | "source": [ 1018 | "tags.head()" 1019 | ] 1020 | }, 1021 | { 1022 | "cell_type": "code", 1023 | "execution_count": null, 1024 | "metadata": {}, 1025 | "outputs": [], 1026 | "source": [ 1027 | "movies.head()" 1028 | ] 1029 | }, 1030 | { 1031 | "cell_type": "code", 1032 | "execution_count": null, 1033 | "metadata": {}, 1034 | "outputs": [], 1035 | "source": [ 1036 | "t = movies.merge(tags, on='movieId', how='inner')\n", 1037 | "t.head()" 1038 | ] 1039 | }, 1040 | { 1041 | "cell_type": "markdown", 1042 | "metadata": {}, 1043 | "source": [ 1044 | "More examples: http://pandas.pydata.org/pandas-docs/stable/merging.html" 1045 | ] 1046 | }, 1047 | { 1048 | "cell_type": "markdown", 1049 | "metadata": {}, 1050 | "source": [ 1051 | "


\n", 1052 | "\n", 1053 | "\n", 1054 | "Combine aggreagation, merging, and filters to get useful analytics\n", 1055 | "

" 1056 | ] 1057 | }, 1058 | { 1059 | "cell_type": "code", 1060 | "execution_count": null, 1061 | "metadata": {}, 1062 | "outputs": [], 1063 | "source": [ 1064 | "avg_ratings = ratings.groupby('movieId', as_index=False).mean()\n", 1065 | "del avg_ratings['userId']\n", 1066 | "avg_ratings.head()" 1067 | ] 1068 | }, 1069 | { 1070 | "cell_type": "code", 1071 | "execution_count": null, 1072 | "metadata": {}, 1073 | "outputs": [], 1074 | "source": [ 1075 | "box_office = movies.merge(avg_ratings, on='movieId', how='inner')\n", 1076 | "box_office.tail()" 1077 | ] 1078 | }, 1079 | { 1080 | "cell_type": "code", 1081 | "execution_count": null, 1082 | "metadata": {}, 1083 | "outputs": [], 1084 | "source": [ 1085 | "is_highly_rated = box_office['rating'] >= 4.0\n", 1086 | "\n", 1087 | "box_office[is_highly_rated][-5:]" 1088 | ] 1089 | }, 1090 | { 1091 | "cell_type": "code", 1092 | "execution_count": null, 1093 | "metadata": {}, 1094 | "outputs": [], 1095 | "source": [ 1096 | "is_comedy = box_office['genres'].str.contains('Comedy')\n", 1097 | "\n", 1098 | "box_office[is_comedy][:5]" 1099 | ] 1100 | }, 1101 | { 1102 | "cell_type": "code", 1103 | "execution_count": null, 1104 | "metadata": {}, 1105 | "outputs": [], 1106 | "source": [ 1107 | "box_office[is_comedy & is_highly_rated][-5:]" 1108 | ] 1109 | }, 1110 | { 1111 | "cell_type": "markdown", 1112 | "metadata": {}, 1113 | "source": [ 1114 | "

Vectorized String Operations

\n" 1115 | ] 1116 | }, 1117 | { 1118 | "cell_type": "code", 1119 | "execution_count": null, 1120 | "metadata": {}, 1121 | "outputs": [], 1122 | "source": [ 1123 | "movies.head()" 1124 | ] 1125 | }, 1126 | { 1127 | "cell_type": "markdown", 1128 | "metadata": {}, 1129 | "source": [ 1130 | "


\n", 1131 | "\n", 1132 | "Split 'genres' into multiple columns\n", 1133 | "\n", 1134 | "

" 1135 | ] 1136 | }, 1137 | { 1138 | "cell_type": "code", 1139 | "execution_count": null, 1140 | "metadata": {}, 1141 | "outputs": [], 1142 | "source": [ 1143 | "movie_genres = movies['genres'].str.split('|', expand=True)" 1144 | ] 1145 | }, 1146 | { 1147 | "cell_type": "code", 1148 | "execution_count": null, 1149 | "metadata": {}, 1150 | "outputs": [], 1151 | "source": [ 1152 | "movie_genres[:10]" 1153 | ] 1154 | }, 1155 | { 1156 | "cell_type": "markdown", 1157 | "metadata": {}, 1158 | "source": [ 1159 | "


\n", 1160 | "\n", 1161 | "Add a new column for comedy genre flag\n", 1162 | "\n", 1163 | "

" 1164 | ] 1165 | }, 1166 | { 1167 | "cell_type": "code", 1168 | "execution_count": null, 1169 | "metadata": { 1170 | "collapsed": true 1171 | }, 1172 | "outputs": [], 1173 | "source": [ 1174 | "movie_genres['isComedy'] = movies['genres'].str.contains('Comedy')" 1175 | ] 1176 | }, 1177 | { 1178 | "cell_type": "code", 1179 | "execution_count": null, 1180 | "metadata": {}, 1181 | "outputs": [], 1182 | "source": [ 1183 | "movie_genres[:10]" 1184 | ] 1185 | }, 1186 | { 1187 | "cell_type": "markdown", 1188 | "metadata": {}, 1189 | "source": [ 1190 | "


\n", 1191 | "\n", 1192 | "Extract year from title e.g. (1995)\n", 1193 | "\n", 1194 | "

" 1195 | ] 1196 | }, 1197 | { 1198 | "cell_type": "code", 1199 | "execution_count": null, 1200 | "metadata": {}, 1201 | "outputs": [], 1202 | "source": [ 1203 | "movies['year'] = movies['title'].str.extract('.*\\((.*)\\).*', expand=True)" 1204 | ] 1205 | }, 1206 | { 1207 | "cell_type": "code", 1208 | "execution_count": null, 1209 | "metadata": {}, 1210 | "outputs": [], 1211 | "source": [ 1212 | "movies.tail()" 1213 | ] 1214 | }, 1215 | { 1216 | "cell_type": "markdown", 1217 | "metadata": {}, 1218 | "source": [ 1219 | "


\n", 1220 | "\n", 1221 | "More here: http://pandas.pydata.org/pandas-docs/stable/text.html#text-string-methods\n", 1222 | "

" 1223 | ] 1224 | }, 1225 | { 1226 | "cell_type": "markdown", 1227 | "metadata": {}, 1228 | "source": [ 1229 | "

Parsing Timestamps

" 1230 | ] 1231 | }, 1232 | { 1233 | "cell_type": "markdown", 1234 | "metadata": {}, 1235 | "source": [ 1236 | "Timestamps are common in sensor data or other time series datasets.\n", 1237 | "Let us revisit the *tags.csv* dataset and read the timestamps!\n" 1238 | ] 1239 | }, 1240 | { 1241 | "cell_type": "code", 1242 | "execution_count": null, 1243 | "metadata": {}, 1244 | "outputs": [], 1245 | "source": [ 1246 | "tags = pd.read_csv('./movielens/tags.csv', sep=',')" 1247 | ] 1248 | }, 1249 | { 1250 | "cell_type": "code", 1251 | "execution_count": null, 1252 | "metadata": {}, 1253 | "outputs": [], 1254 | "source": [ 1255 | "tags.dtypes" 1256 | ] 1257 | }, 1258 | { 1259 | "cell_type": "markdown", 1260 | "metadata": { 1261 | "collapsed": true 1262 | }, 1263 | "source": [ 1264 | "

\n", 1265 | "\n", 1266 | "Unix time / POSIX time / epoch time records \n", 1267 | "time in seconds
since midnight Coordinated Universal Time (UTC) of January 1, 1970\n", 1268 | "

" 1269 | ] 1270 | }, 1271 | { 1272 | "cell_type": "code", 1273 | "execution_count": null, 1274 | "metadata": {}, 1275 | "outputs": [], 1276 | "source": [ 1277 | "tags.head(5)" 1278 | ] 1279 | }, 1280 | { 1281 | "cell_type": "code", 1282 | "execution_count": null, 1283 | "metadata": { 1284 | "collapsed": true 1285 | }, 1286 | "outputs": [], 1287 | "source": [ 1288 | "tags['parsed_time'] = pd.to_datetime(tags['timestamp'], unit='s')" 1289 | ] 1290 | }, 1291 | { 1292 | "cell_type": "markdown", 1293 | "metadata": {}, 1294 | "source": [ 1295 | "

\n", 1296 | "\n", 1297 | "Data Type datetime64[ns] maps to either M8[ns] depending on the hardware\n", 1298 | "\n", 1299 | "

" 1300 | ] 1301 | }, 1302 | { 1303 | "cell_type": "code", 1304 | "execution_count": null, 1305 | "metadata": {}, 1306 | "outputs": [], 1307 | "source": [ 1308 | "\n", 1309 | "tags['parsed_time'].dtype" 1310 | ] 1311 | }, 1312 | { 1313 | "cell_type": "code", 1314 | "execution_count": null, 1315 | "metadata": {}, 1316 | "outputs": [], 1317 | "source": [ 1318 | "tags.head(2)" 1319 | ] 1320 | }, 1321 | { 1322 | "cell_type": "markdown", 1323 | "metadata": {}, 1324 | "source": [ 1325 | "

\n", 1326 | "\n", 1327 | "Selecting rows based on timestamps\n", 1328 | "

" 1329 | ] 1330 | }, 1331 | { 1332 | "cell_type": "code", 1333 | "execution_count": null, 1334 | "metadata": {}, 1335 | "outputs": [], 1336 | "source": [ 1337 | "greater_than_t = tags['parsed_time'] > '2015-02-01'\n", 1338 | "\n", 1339 | "selected_rows = tags[greater_than_t]\n", 1340 | "\n", 1341 | "tags.shape, selected_rows.shape" 1342 | ] 1343 | }, 1344 | { 1345 | "cell_type": "markdown", 1346 | "metadata": {}, 1347 | "source": [ 1348 | "

\n", 1349 | "\n", 1350 | "Sorting the table using the timestamps\n", 1351 | "

" 1352 | ] 1353 | }, 1354 | { 1355 | "cell_type": "code", 1356 | "execution_count": null, 1357 | "metadata": {}, 1358 | "outputs": [], 1359 | "source": [ 1360 | "tags.sort_values(by='parsed_time', ascending=True)[:10]" 1361 | ] 1362 | }, 1363 | { 1364 | "cell_type": "markdown", 1365 | "metadata": {}, 1366 | "source": [ 1367 | "

Average Movie Ratings over Time

\n", 1368 | "## Are Movie ratings related to the year of launch?" 1369 | ] 1370 | }, 1371 | { 1372 | "cell_type": "code", 1373 | "execution_count": null, 1374 | "metadata": {}, 1375 | "outputs": [], 1376 | "source": [ 1377 | "average_rating = ratings[['movieId','rating']].groupby('movieId', as_index=False).mean()\n", 1378 | "average_rating.tail()" 1379 | ] 1380 | }, 1381 | { 1382 | "cell_type": "code", 1383 | "execution_count": null, 1384 | "metadata": {}, 1385 | "outputs": [], 1386 | "source": [ 1387 | "joined = movies.merge(average_rating, on='movieId', how='inner')\n", 1388 | "joined.head()\n", 1389 | "joined.corr()" 1390 | ] 1391 | }, 1392 | { 1393 | "cell_type": "code", 1394 | "execution_count": null, 1395 | "metadata": {}, 1396 | "outputs": [], 1397 | "source": [ 1398 | "yearly_average = joined[['year','rating']].groupby('year', as_index=False).mean()\n", 1399 | "yearly_average[:10]" 1400 | ] 1401 | }, 1402 | { 1403 | "cell_type": "code", 1404 | "execution_count": null, 1405 | "metadata": {}, 1406 | "outputs": [], 1407 | "source": [ 1408 | "yearly_average[-20:].plot(x='year', y='rating', figsize=(15,10), grid=True)" 1409 | ] 1410 | }, 1411 | { 1412 | "cell_type": "markdown", 1413 | "metadata": {}, 1414 | "source": [ 1415 | "

\n", 1416 | "\n", 1417 | "Do some years look better for the boxoffice movies than others?

\n", 1418 | "\n", 1419 | "Does any data point seem like an outlier in some sense?\n", 1420 | "\n", 1421 | "

" 1422 | ] 1423 | }, 1424 | { 1425 | "cell_type": "code", 1426 | "execution_count": null, 1427 | "metadata": { 1428 | "collapsed": true 1429 | }, 1430 | "outputs": [], 1431 | "source": [] 1432 | } 1433 | ], 1434 | "metadata": { 1435 | "kernelspec": { 1436 | "display_name": "Python 3", 1437 | "language": "python", 1438 | "name": "python3" 1439 | }, 1440 | "language_info": { 1441 | "codemirror_mode": { 1442 | "name": "ipython", 1443 | "version": 3 1444 | }, 1445 | "file_extension": ".py", 1446 | "mimetype": "text/x-python", 1447 | "name": "python", 1448 | "nbconvert_exporter": "python", 1449 | "pygments_lexer": "ipython3", 1450 | "version": "3.6.5" 1451 | } 1452 | }, 1453 | "nbformat": 4, 1454 | "nbformat_minor": 1 1455 | } 1456 | -------------------------------------------------------------------------------- /Phase 1/Numpy_Pandas/OReilly Python for Data Analysis.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oss2019/text-summarization/7387e695d011d34a63eaa232c312f6cbf3e32b61/Phase 1/Numpy_Pandas/OReilly Python for Data Analysis.pdf -------------------------------------------------------------------------------- /Phase 1/Numpy_Pandas/README.md: -------------------------------------------------------------------------------- 1 | Credits to edX, UCSanDiegoX. 2 | -------------------------------------------------------------------------------- /Phase 1/Python assignment/README.md: -------------------------------------------------------------------------------- 1 | # Python Word Count 2 | 3 | You've likely seen word-clouds before, if not, please check [here](https://www.google.com/search?site=&tbm=isch&source=hp&biw=1536&bih=799&q=word+cloud&oq=word+cloud&gs_l=img.3..0l10.981.2160.0.2280.11.11.0.0.0.0.95.704.9.9.0....0...1.1.64.img..2.9.695.0.NtfMDYloQTw) for examples. In order to create word clouds, the software finds the most frequently occurring words in a text file. This assignment will ask you to do just that! We'll use the text of the famous novel by Leo Tolstoy, **War and Peace** for this assignment!! 4 | 5 | ## Part 1 : Writing and running Python code 6 | 7 | Make sure you have the environment for coding already setup. Feel free to create a python program using a text editor or you can do all the work in python shell. Or, if you already have some experience in Jupyter notebooks, feel free to do your work there instead. 8 | If you have any doubts, feel free to ping us any time or just open an issue if you feel so .. 9 | 10 | ## Part 2 : Grab the source files 11 | 12 | Get the resources for this assignment [here](https://github.com/oss2019/text-summarization/tree/master/Phase%201/Python%20assignment/resources)! 13 | 14 | 1. 2600-0.txt : War and Peace - Leo Tolstoy. Credit to [Project Gutenberg](https://www.gutenberg.org/) 15 | 2. stopwords.txt : common words to exlude. Credit to [Andreas Mueller](https://github.com/amueller/word_cloud/) 16 | 17 | ## Part 3 : Word Count 18 | 19 | To complete this assignment, you will want to read and clean the input, then count the frequencies of each word. Remember that the data pre processing step is the most important step for any analysis which you do! Go through the dataset(text file here) atleast once and then go on with your analysis! 20 | 21 | Your overall approach should be : 22 | - Think of a data structure to store the words and the number of occurrances of the word. 23 | - Read in each word from the file, **making it lower case and removing punctuation**. ( Remove the punctuation marks from the file) 24 | - For simplicity and to keep the results uniform consider **only the following 10 punctuation marks for removal:** 25 | **( ",", "-", "'", ".", '"', '_', '\\', '“', '”', '*')** 26 | - Then extract the **Top x** positions which you would like from any one of the issues!! 27 | - Also don't forget to **exclude the stopwords** (common words). 28 | - If you used an unordered data structure like a dictionary, you might need to get the values out of it (into a list) to sort it. You could also use [collections.Counter](https://docs.python.org/2/library/collections.html) from the Collections module to help with this step! 29 | - Please note the output format for your file :- 30 | 31 | **word1 : number_of_occurrences** 32 | 33 | **word2 : number_of_occurrences** 34 | 35 | - We have opened an issue for every **Top x most common words**; So everyone can work on any one of these issues. 36 | - Finally create a file named **Topx.txt** for your issue and place it in the the Python assignment folder inside Phase 1 directory. 37 | As an example, if you are working on the issue **Top 15 most common words**, then place the file **Top15.txt** inside **Phase 1/Python assignment/** 38 | 39 | - Also feel free to verify other contributors most common words with yours and in case of mismatch you can point out on their issue if you're confident that your's right!*(Maybe extra points for this :p)* 40 | - Using the given stopwords and removing the above 10 punctuation marks here are the **Top 3 most common words** which we found : 41 | 42 | **said : 2762** 43 | 44 | **one : 2008** 45 | 46 | **prince : 1856** 47 | -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top10.txt: -------------------------------------------------------------------------------- 1 | Words Frequency 2 | 21950 said 2762 3 | 533 one 2008 4 | 5656 prince 1856 5 | 21239 pierre 1753 6 | 1984 now 1242 7 | 9866 natásha 1061 8 | 24773 will 1050 9 | 21473 man 1031 10 | 5208 andrew 1015 11 | 18987 time 891 -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top100.txt: -------------------------------------------------------------------------------- 1 | said : 2834 2 | one : 2047 3 | prince : 1856 4 | pierre : 1784 5 | would : 1362 6 | could : 1111 7 | natásha : 1092 8 | man : 1064 9 | andrew : 1039 10 | time : 921 11 | princess : 915 12 | face : 891 13 | went : 881 14 | french : 872 15 | went : 859 16 | know : 840 17 | eyes : 820 18 | old : 803 19 | room : 766 20 | thought : 764 21 | men : 760 22 | go : 752 23 | well : 735 24 | like : 733 25 | chapter : 732 26 | see : 730 27 | rostóv : 715 28 | began : 714 29 | moscow : 707 30 | came : 681 31 | come : 679 32 | without : 669 33 | asked : 668 34 | still : 665 35 | count : 650 36 | looked : 647 37 | army : 641 38 | say : 637 39 | felt : 628 40 | nicholas : 626 41 | first : 618 42 | away : 613 43 | mary : 612 44 | left : 605 45 | another : 601 46 | something : 597 47 | life : 589 48 | two : 587 49 | seemed : 579 50 | head : 565 51 | little : 554 52 | yes : 550 53 | day : 543 54 | hand : 536 55 | whole : 531 56 | dont : 528 57 | people : 524 58 | emperor : 522 59 | back : 515 60 | long : 512 61 | even : 503 62 | heard : 497 63 | way : 493 64 | countess : 484 65 | general : 484 66 | must : 482 67 | look : 475 68 | napoleon : 470 69 | always : 464 70 | saw : 462 71 | nothing : 461 72 | made : 458 73 | russian : 452 74 | right : 449 75 | kutúzov : 445 76 | though : 443 77 | young : 442 78 | love : 441 79 | suddenly : 428 80 | voice : 423 81 | round : 421 82 | us : 420 83 | smile : 414 84 | moment : 413 85 | sónya : 411 86 | officer : 410 87 | knew : 409 88 | told : 409 89 | never : 407 90 | everything : 406 91 | took : 396 92 | much : 394 93 | words : 391 94 | looking : 390 95 | house : 389 96 | turned : 384 97 | dear : 383 98 | good : 381 99 | let : 376 100 | tell : 375 101 | -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top15.txt: -------------------------------------------------------------------------------- 1 | said: 2762 2 | one: 2008 3 | prince: 1856 4 | pierre: 1753 5 | now: 1242 6 | natásha: 1061 7 | will: 1050 8 | man: 1031 9 | andrew: 1015 10 | time: 891 11 | face: 885 12 | princess: 859 13 | went: 857 14 | french: 847 15 | eyes: 815 16 | -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top20.txt: -------------------------------------------------------------------------------- 1 | said : 2762 2 | one : 2008 3 | prince : 1856 4 | pierre : 1753 5 | now : 1242 6 | natásha : 1061 7 | will : 1050 8 | man : 1031 9 | andrew : 1015 10 | time : 891 11 | face : 885 12 | princess : 859 13 | went : 857 14 | french : 847 15 | eyes : 815 16 | know : 806 17 | old : 801 18 | room : 757 19 | thought : 752 20 | men : 747 -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top25.txt: -------------------------------------------------------------------------------- 1 | said : 2762 2 | one : 2008 3 | prince : 1856 4 | pierre : 1753 5 | now : 1242 6 | natásha : 1061 7 | will : 1050 8 | man : 1031 9 | andrew : 1015 10 | time : 891 11 | face : 885 12 | princess : 859 13 | went : 857 14 | french : 847 15 | eyes : 815 16 | know : 806 17 | old : 801 18 | room : 757 19 | thought : 752 20 | men : 747 21 | chapter : 731 22 | began : 708 23 | see : 703 24 | rostóv : 702 25 | go : 701 -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top30.txt: -------------------------------------------------------------------------------- 1 | said : 2762 2 | one : 2008 3 | prince : 1856 4 | pierre : 1753 5 | now : 1242 6 | natásha : 1061 7 | will : 1050 8 | man : 1031 9 | andrew : 1015 10 | time : 891 11 | face : 885 12 | princess : 859 13 | went : 857 14 | french : 847 15 | eyes : 815 16 | know : 806 17 | old : 801 18 | room : 757 19 | thought : 752 20 | men : 747 21 | chapter : 731 22 | began : 708 23 | see : 703 24 | rostóv : 702 25 | go : 701 26 | came : 680 27 | without : 667 28 | moscow : 665 29 | asked : 664 30 | still : 659 -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top35.txt: -------------------------------------------------------------------------------- 1 | said : 2762 2 | one : 2008 3 | prince : 1856 4 | pierre : 1753 5 | now : 1242 6 | natásha : 1061 7 | will : 1050 8 | man : 1031 9 | andrew : 1015 10 | time : 891 11 | face : 885 12 | princess : 859 13 | went : 857 14 | french : 847 15 | eyes : 815 16 | know : 806 17 | old : 801 18 | room : 757 19 | thought : 752 20 | men : 747 21 | chapter : 731 22 | began : 708 23 | see : 703 24 | rostóv : 702 25 | go : 701 26 | came : 680 27 | without : 667 28 | moscow : 665 29 | asked : 664 30 | still : 659 31 | looked : 646 32 | come : 646 33 | well : 640 34 | felt : 626 35 | count : 616 -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top40.txt: -------------------------------------------------------------------------------- 1 | said : 2762 2 | one : 2008 3 | prince : 1856 4 | pierre : 1753 5 | now : 1242 6 | natásha : 1061 7 | will : 1050 8 | man : 1031 9 | andrew : 1015 10 | time : 891 11 | face : 885 12 | princess : 859 13 | went : 857 14 | french : 847 15 | eyes : 815 16 | know : 806 17 | old : 801 18 | room : 757 19 | thought : 752 20 | men : 747 21 | chapter : 731 22 | began : 708 23 | see : 703 24 | rostóv : 702 25 | go : 701 26 | came : 680 27 | without : 667 28 | moscow : 665 29 | asked : 664 30 | still : 659 31 | looked : 646 32 | come : 646 33 | well : 640 34 | felt : 626 35 | count : 616 36 | army : 615 37 | first : 612 38 | left : 596 39 | mary : 595 40 | another : 591 41 | -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top45.txt: -------------------------------------------------------------------------------- 1 | said: 2762 2 | one: 2008 3 | prince: 1856 4 | pierre: 1753 5 | now: 1242 6 | natásha: 1061 7 | will: 1050 8 | man: 1031 9 | andrew: 1015 10 | time: 891 11 | face: 885 12 | princess: 859 13 | went: 857 14 | french: 847 15 | eyes: 815 16 | know: 806 17 | old: 801 18 | room: 757 19 | thought: 752 20 | men: 747 21 | chapter: 731 22 | began: 708 23 | see: 703 24 | rostóv: 702 25 | go: 701 26 | came: 680 27 | without: 667 28 | moscow: 665 29 | asked: 664 30 | still: 659 31 | looked: 646 32 | come: 646 33 | well: 640 34 | felt: 626 35 | count: 616 36 | army: 615 37 | first: 612 38 | left: 596 39 | mary: 595 40 | another: 591 41 | something: 589 42 | say: 579 43 | seemed: 578 44 | two: 573 45 | away: 572 46 | -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top5.txt: -------------------------------------------------------------------------------- 1 | Words Frequency 2 | 21950 said 2762 3 | 533 one 2008 4 | 5656 prince 1856 5 | 21239 pierre 1753 6 | 1984 now 1242 -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top50.txt: -------------------------------------------------------------------------------- 1 | said : 2762 2 | one : 2008 3 | prince : 1856 4 | pierre : 1753 5 | now : 1242 6 | natásha : 1061 7 | will : 1050 8 | man : 1031 9 | andrew : 1015 10 | time : 891 11 | face : 885 12 | princess : 859 13 | went : 857 14 | french : 847 15 | eyes : 815 16 | know : 806 17 | old : 801 18 | room : 757 19 | thought : 752 20 | men : 747 21 | chapter : 731 22 | began : 708 23 | see : 703 24 | rostóv : 702 25 | go : 701 26 | came : 680 27 | without : 667 28 | moscow : 665 29 | asked : 664 30 | still : 659 31 | come : 646 32 | looked : 646 33 | well : 640 34 | felt : 626 35 | count : 616 36 | army : 615 37 | first : 612 38 | left : 596 39 | mary : 595 40 | another : 591 41 | something : 589 42 | say : 579 43 | seemed : 578 44 | two : 573 45 | away : 572 46 | nicholas : 570 47 | life : 563 48 | head : 558 49 | little : 552 50 | day : 535 51 | -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top60.txt: -------------------------------------------------------------------------------- 1 | said : 2762 2 | one : 2008 3 | prince : 1856 4 | pierre : 1753 5 | now : 1242 6 | natásha : 1061 7 | will : 1050 8 | man : 1031 9 | andrew : 1015 10 | time : 891 11 | face : 885 12 | princess : 859 13 | went : 857 14 | french : 847 15 | eyes : 815 16 | know : 806 17 | old : 801 18 | room : 757 19 | thought : 752 20 | men : 747 21 | chapter : 731 22 | began : 708 23 | see : 703 24 | rostóv : 702 25 | go : 701 26 | came : 680 27 | without : 667 28 | moscow : 665 29 | asked : 664 30 | still : 659 31 | looked : 646 32 | come : 646 33 | felt : 626 34 | count : 616 35 | army : 615 36 | first : 612 37 | left : 596 38 | mary : 595 39 | another : 591 40 | something : 589 41 | say : 579 42 | seemed : 578 43 | two : 573 44 | away : 572 45 | nicholas : 570 46 | life : 563 47 | head : 558 48 | little : 552 49 | day : 535 50 | whole : 528 51 | hand : 527 52 | don’t : 515 53 | people : 508 54 | yes : 503 55 | even : 503 56 | long : 501 57 | back : 497 58 | emperor : 495 59 | heard : 491 60 | must : 480 61 | -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top65.txt: -------------------------------------------------------------------------------- 1 | said : 2762 2 | one : 2008 3 | prince : 1856 4 | pierre : 1753 5 | now : 1242 6 | natásha : 1061 7 | will : 1050 8 | man : 1031 9 | andrew : 1015 10 | time : 891 11 | face : 885 12 | princess : 859 13 | went : 857 14 | french : 847 15 | eyes : 815 16 | know : 806 17 | old : 801 18 | room : 757 19 | thought : 752 20 | men : 747 21 | chapter : 731 22 | began : 708 23 | see : 703 24 | rostóv : 702 25 | go : 701 26 | came : 680 27 | without : 667 28 | moscow : 665 29 | asked : 664 30 | still : 659 31 | looked : 646 32 | come : 646 33 | well : 640 34 | felt : 626 35 | count : 616 36 | army : 615 37 | first : 612 38 | left : 596 39 | mary : 595 40 | another : 591 41 | something: 589 42 | say : 579 43 | seemed : 578 44 | two : 573 45 | away : 572 46 | nicholas : 570 47 | life : 563 48 | head : 558 49 | little : 552 50 | day : 535 51 | whole : 528 52 | hand : 527 53 | don’t : 515 54 | people : 508 55 | even : 503 56 | yes : 503 57 | long : 501 58 | back : 497 59 | emperor : 495 60 | heard : 491 61 | must : 480 62 | general : 468 63 | way : 467 64 | napoleon : 462 65 | always : 461 66 | -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top75.txt: -------------------------------------------------------------------------------- 1 | said: 2762 2 | one: 2008 3 | prince: 1856 4 | pierre: 1753 5 | now: 1242 6 | natásha: 1061 7 | will: 1050 8 | man: 1031 9 | andrew: 1015 10 | time: 891 11 | face: 885 12 | princess: 859 13 | went: 857 14 | french: 847 15 | eyes: 815 16 | know: 806 17 | old: 801 18 | room: 757 19 | thought: 752 20 | men: 747 21 | chapter: 731 22 | began: 708 23 | see: 703 24 | rostóv: 702 25 | go: 701 26 | came: 680 27 | without: 667 28 | moscow: 665 29 | asked: 664 30 | still: 659 31 | looked: 646 32 | come: 646 33 | well: 640 34 | felt: 626 35 | count: 616 36 | army: 615 37 | first: 612 38 | left: 596 39 | mary: 595 40 | another: 591 41 | something: 589 42 | say: 579 43 | seemed: 578 44 | two: 573 45 | away: 572 46 | nicholas: 570 47 | life: 563 48 | head: 558 49 | little: 552 50 | day: 535 51 | whole: 528 52 | hand: 527 53 | don’t: 515 54 | people: 508 55 | even: 503 56 | yes: 503 57 | long: 501 58 | back: 497 59 | emperor: 495 60 | heard: 491 61 | must: 480 62 | general: 468 63 | way: 467 64 | napoleon: 462 65 | always: 461 66 | saw: 461 67 | look: 461 68 | made: 457 69 | russian: 449 70 | nothing: 442 71 | young: 440 72 | though: 435 73 | countess: 434 74 | kutúzov: 430 75 | suddenly: 428 76 | -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top80.txt: -------------------------------------------------------------------------------- 1 | said : 2762 2 | one : 2008 3 | prince : 1856 4 | pierre : 1753 5 | now : 1242 6 | natásha : 1061 7 | will : 1050 8 | man : 1032 9 | andrew : 1015 10 | princess : 893 11 | time : 891 12 | face : 885 13 | went : 857 14 | french : 847 15 | eyes : 815 16 | know : 806 17 | old : 801 18 | room : 757 19 | thought : 752 20 | men : 747 21 | chapter : 731 22 | began : 708 23 | see : 703 24 | go : 702 25 | rostóv : 702 26 | well : 694 27 | came : 680 28 | without : 667 29 | moscow : 665 30 | asked : 664 31 | still : 659 32 | looked : 646 33 | come : 646 34 | felt : 626 35 | count : 616 36 | army : 615 37 | first : 612 38 | nicholas : 599 39 | left : 596 40 | mary : 595 41 | another : 591 42 | something : 589 43 | say : 579 44 | seemed : 578 45 | away : 574 46 | two : 574 47 | life : 563 48 | head : 558 49 | little : 552 50 | day : 535 51 | whole : 530 52 | hand : 528 53 | dont : 517 54 | people : 509 55 | even : 503 56 | yes : 503 57 | long : 501 58 | back : 497 59 | emperor : 496 60 | heard : 491 61 | must : 480 62 | countess : 471 63 | general : 468 64 | way : 467 65 | napoleon : 462 66 | always : 461 67 | saw : 461 68 | look : 461 69 | made : 457 70 | russian : 449 71 | nothing : 442 72 | young : 440 73 | though : 435 74 | kutúzov : 430 75 | suddenly : 428 76 | love : 426 77 | round : 418 78 | knew : 407 79 | right : 407 80 | voice : 407) -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top85.txt: -------------------------------------------------------------------------------- 1 | said : 2762 2 | one : 2008 3 | prince : 1856 4 | pierre : 1753 5 | now : 1242 6 | natásha : 1061 7 | will : 1050 8 | man : 1031 9 | andrew : 1015 10 | time : 891 11 | face : 885 12 | princess : 859 13 | went : 857 14 | french : 847 15 | eyes : 815 16 | know : 806 17 | old : 801 18 | room : 757 19 | thought : 752 20 | men : 747 21 | chapter : 731 22 | began : 708 23 | see : 703 24 | rostóv : 702 25 | go : 701 26 | came : 680 27 | without : 667 28 | moscow : 665 29 | asked : 664 30 | still : 659 31 | looked : 646 32 | come : 646 33 | well : 640 34 | felt : 626 35 | count : 616 36 | army : 615 37 | first : 612 38 | left : 596 39 | mary : 595 40 | another : 591 41 | something : 589 42 | say : 579 43 | seemed : 578 44 | two : 573 45 | away : 572 46 | nicholas : 570 47 | life : 563 48 | head : 558 49 | little : 552 50 | day : 535 51 | whole : 528 52 | hand : 527 53 | don’t : 515 54 | people : 508 55 | even : 503 56 | yes : 503 57 | long : 501 58 | back : 497 59 | emperor : 495 60 | heard : 491 61 | must : 480 62 | general : 468 63 | way : 467 64 | napoleon : 462 65 | always : 461 66 | saw : 461 67 | look : 461 68 | made : 457 69 | russian : 449 70 | nothing : 442 71 | young : 440 72 | though : 435 73 | countess : 434 74 | kutúzov : 430 75 | suddenly : 428 76 | love : 426 77 | round : 418 78 | knew : 407 79 | right : 407 80 | voice : 407 81 | smile : 406 82 | never : 405 83 | told : 405 84 | officer : 402 85 | moment : 400 -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top90.txt: -------------------------------------------------------------------------------- 1 | said:2762 2 | one:2008 3 | prince:1856 4 | pierre:1753 5 | now:1242 6 | natásha:1061 7 | will:1050 8 | man:1031 9 | andrew:1015 10 | time:891 11 | face:885 12 | princess:859 13 | went:857 14 | french:847 15 | eyes:815 16 | know:806 17 | old:801 18 | room:757 19 | thought:752 20 | men:747 21 | chapter:731 22 | began:708 23 | see:703 24 | rostóv:702 25 | go:701 26 | came:680 27 | without:667 28 | moscow:665 29 | asked:664 30 | still:659 31 | looked:646 32 | come:646 33 | well:640 34 | felt:626 35 | count:616 36 | army:615 37 | first:612 38 | left:596 39 | mary:595 40 | another:591 41 | something:589 42 | say:579 43 | seemed:578 44 | two:573 45 | away:572 46 | nicholas:570 47 | life:563 48 | head:558 49 | little:552 50 | day:535 51 | whole:528 52 | hand:527 53 | don’t:515 54 | people:508 55 | even:503 56 | yes:503 57 | long:501 58 | back:497 59 | emperor:495 60 | heard:491 61 | must:480 62 | general:468 63 | way:467 64 | napoleon:462 65 | always:461 66 | saw:461 67 | look:461 68 | made:457 69 | russian:449 70 | nothing:442 71 | young:440 72 | though:435 73 | countess:434 74 | kutúzov:430 75 | suddenly:428 76 | love:426 77 | round:418 78 | knew:407 79 | right:407 80 | voice:407 81 | smile:406 82 | never:405 83 | told:405 84 | officer:402 85 | moment:400 86 | took:395 87 | looking:389 88 | us:389 89 | everything:386 90 | much:385 91 | -------------------------------------------------------------------------------- /Phase 1/Python assignment/Top95.txt: -------------------------------------------------------------------------------- 1 | said 2762 2 | one 2008 3 | prince 1856 4 | pierre 1753 5 | now 1242 6 | natásha 1061 7 | will 1050 8 | man 1031 9 | andrew 1015 10 | time 891 11 | face 885 12 | princess 859 13 | went 857 14 | french 847 15 | eyes 815 16 | know 806 17 | old 801 18 | room 757 19 | thought 752 20 | men 747 21 | chapter 731 22 | began 708 23 | see 703 24 | rostóv 702 25 | go 701 26 | came 680 27 | without 667 28 | moscow 665 29 | asked 664 30 | still 659 31 | looked 646 32 | come 646 33 | well 640 34 | felt 626 35 | count 616 36 | army 615 37 | first 612 38 | left 596 39 | mary 595 40 | another 591 41 | something 589 42 | say 579 43 | seemed 578 44 | two 573 45 | away 572 46 | nicholas 570 47 | life 563 48 | head 558 49 | little 552 50 | day 535 51 | whole 528 52 | hand 527 53 | don’t 515 54 | people 508 55 | even 503 56 | yes 503 57 | long 501 58 | back 497 59 | emperor 495 60 | heard 491 61 | must 480 62 | general 468 63 | way 467 64 | napoleon 462 65 | always 461 66 | saw 461 67 | look 461 68 | made 457 69 | russian 449 70 | nothing 442 71 | young 440 72 | though 435 73 | countess 434 74 | kutúzov 430 75 | suddenly 428 76 | love 426 77 | round 418 78 | knew 407 79 | right 407 80 | voice 407 81 | smile 406 82 | never 405 83 | told 405 84 | officer 402 85 | moment 400 86 | took 395 87 | looking 389 88 | us 389 89 | everything 386 90 | much 385 91 | sónya 385 92 | turned 384 93 | let 375 94 | quite 374 95 | tell 373 96 | -------------------------------------------------------------------------------- /Phase 1/Python assignment/resources/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Phase 1/Python assignment/resources/stopwords.txt: -------------------------------------------------------------------------------- 1 | a 2 | about 3 | above 4 | after 5 | again 6 | against 7 | all 8 | am 9 | an 10 | and 11 | any 12 | are 13 | aren't 14 | as 15 | at 16 | be 17 | because 18 | been 19 | before 20 | being 21 | below 22 | between 23 | both 24 | but 25 | by 26 | can 27 | can't 28 | cannot 29 | com 30 | could 31 | couldn't 32 | did 33 | didn't 34 | do 35 | does 36 | doesn't 37 | doing 38 | don't 39 | down 40 | during 41 | each 42 | else 43 | ever 44 | few 45 | for 46 | from 47 | further 48 | get 49 | had 50 | hadn't 51 | has 52 | hasn't 53 | have 54 | haven't 55 | having 56 | he 57 | he'd 58 | he'll 59 | he's 60 | her 61 | here 62 | here's 63 | hers 64 | herself 65 | him 66 | himself 67 | his 68 | how 69 | how's 70 | http 71 | i 72 | i'd 73 | i'll 74 | i'm 75 | i've 76 | if 77 | in 78 | into 79 | is 80 | isn't 81 | it 82 | it's 83 | its 84 | itself 85 | just 86 | k 87 | let's 88 | like 89 | me 90 | more 91 | most 92 | mustn't 93 | my 94 | myself 95 | no 96 | nor 97 | not 98 | of 99 | off 100 | on 101 | once 102 | only 103 | or 104 | other 105 | ought 106 | our 107 | ours 108 | ourselves 109 | out 110 | over 111 | own 112 | r 113 | same 114 | shall 115 | shan't 116 | she 117 | she'd 118 | she'll 119 | she's 120 | should 121 | shouldn't 122 | so 123 | some 124 | such 125 | than 126 | that 127 | that's 128 | the 129 | their 130 | theirs 131 | them 132 | themselves 133 | then 134 | there 135 | there's 136 | these 137 | they 138 | they'd 139 | they'll 140 | they're 141 | they've 142 | this 143 | those 144 | through 145 | to 146 | too 147 | under 148 | until 149 | up 150 | very 151 | was 152 | wasn't 153 | we 154 | we'd 155 | we'll 156 | we're 157 | we've 158 | were 159 | weren't 160 | what 161 | what's 162 | when 163 | when's 164 | where 165 | where's 166 | which 167 | while 168 | who 169 | who's 170 | whom 171 | why 172 | why's 173 | with 174 | won't 175 | would 176 | wouldn't 177 | www 178 | you 179 | you'd 180 | you'll 181 | you're 182 | you've 183 | your 184 | yours 185 | yourself 186 | yourselves 187 | -------------------------------------------------------------------------------- /Phase 1/Python assignment/top55.txt: -------------------------------------------------------------------------------- 1 | said : 2762 2 | one : 2008 3 | prince : 1856 4 | pierre : 1753 5 | now : 1242 6 | natásha : 1061 7 | will : 1050 8 | man : 1031 9 | andrew : 1015 10 | time : 891 11 | face : 885 12 | princess : 859 13 | went : 857 14 | french : 847 15 | eyes : 815 16 | know : 806 17 | old : 801 18 | room : 757 19 | thought : 752 20 | men : 747 21 | chapter : 731 22 | began : 708 23 | see : 703 24 | rostóv : 702 25 | go : 701 26 | came : 680 27 | without : 667 28 | moscow : 665 29 | asked : 664 30 | still : 659 31 | looked : 646 32 | come : 646 33 | well : 640 34 | felt : 626 35 | count : 616 36 | army : 615 37 | first : 612 38 | left : 596 39 | mary : 595 40 | another : 591 41 | something : 589 42 | say : 579 43 | seemed : 578 44 | two : 573 45 | away : 572 46 | nicholas : 570 47 | life : 563 48 | head : 558 49 | little : 552 50 | day : 535 51 | whole : 528 52 | hand : 527 53 | don’t : 515 54 | people : 508 55 | even : 503 56 | -------------------------------------------------------------------------------- /Phase 1/Python assignment/top70.txt: -------------------------------------------------------------------------------- 1 | said : 2762 2 | one : 2008 3 | prince : 1856 4 | pierre : 1753 5 | now : 1242 6 | natásha : 1061 7 | will : 1050 8 | man : 1031 9 | andrew : 1015 10 | time : 891 11 | face : 885 12 | princess : 859 13 | went : 857 14 | french : 847 15 | eyes : 815 16 | know : 806 17 | old : 801 18 | room : 757 19 | thought : 752 20 | men : 747 21 | began : 708 22 | see : 703 23 | rostóv : 702 24 | go : 701 25 | came : 680 26 | without : 667 27 | moscow : 665 28 | asked : 664 29 | still : 659 30 | looked : 646 31 | come : 646 32 | well : 640 33 | felt : 626 34 | count : 616 35 | army : 615 36 | first : 611 37 | left : 596 38 | mary : 595 39 | another : 591 40 | something : 589 41 | say : 579 42 | seemed : 578 43 | two : 573 44 | away : 571 45 | nicholas : 570 46 | life : 563 47 | head : 558 48 | little : 552 49 | day : 535 50 | whole : 528 51 | hand : 527 52 | don’t : 515 53 | people : 508 54 | even : 503 55 | yes : 503 56 | long : 501 57 | back : 497 58 | emperor : 495 59 | heard : 491 60 | must : 480 61 | general : 468 62 | way : 467 63 | napoleon : 462 64 | always : 461 65 | saw : 461 66 | look : 461 67 | made : 457 68 | russian : 449 69 | nothing : 442 70 | young : 440 71 | 72 | -------------------------------------------------------------------------------- /Phase 2/Supervised_Learning.md: -------------------------------------------------------------------------------- 1 | # The Supervised Learning Paradigm 2 | 3 | Supervision in machine learning, or supervised learning, refers to cases where the ground truth for the 4 | targets (what’s being predicted) is available for the observations. For example, in document 5 | classification, the target is a categorical label, and the observation is a document. In machine 6 | translation, the observation is a sentence in one language and the target is a sentence in another 7 | language.And similarly in text summarization, the observation is any text input and the target is much simplified and shorter text. With this understanding of the input data, the figure below illustrates the supervised learning paradigm: 8 | 9 | 10 | 11 | 12 | ![supervised learning](https://github.com/Sedherthe/text-summarization/blob/master/Phase%202/images/supervised_learning.png) 13 | 14 | 15 | 16 | We can break down the supervised learning paradigm, as illustrated in the Figure, to six main concepts: 17 | 18 | * **Observations** 19 | 20 | Observations are items about which we want to predict something. We denote observations using 21 | x. We sometimes refer to the observations as inputs. 22 | 23 | * **Targets** 24 | 25 | Targets are labels corresponding to an observation. These are usually the things being predicted. 26 | Following standard notations in machine learning/deep learning, we use y to refer to these. 27 | Sometimes, these labels known as the ground truth. 28 | 29 | * **Model** 30 | 31 | A model is a mathematical expression or a function that takes an observation, x, and predicts the 32 | value of its target label. 33 | 34 | * **Parameters** 35 | 36 | Sometimes also called weights, these parameterize the model. It is standard to use the notation w 37 | (for weights) or ŵ. 38 | 39 | * **Predictions** 40 | 41 | Predictions, also called estimates, are the values of the targets guessed by the model, given the 42 | observations. We denote these using a “hat” notation. So, the prediction of a target y is denoted as 43 | ŷ. 44 | 45 | * **Loss Function** 46 | 47 | A loss function is a function that compares how far off a prediction is from its target for 48 | observations in the training data. Given a target and its prediction, the loss function assigns a scalar 49 | real value called the loss. The lower the value of the loss, the better the model is at predicting the 50 | target. We use L to denote the loss function. 51 | 52 | 53 | -------------------------------------------------------------------------------- /Phase 2/images/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Phase 2/images/supervised_learning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oss2019/text-summarization/7387e695d011d34a63eaa232c312f6cbf3e32b61/Phase 2/images/supervised_learning.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Text-Summarization 2 | 3 | [![Issues](https://img.shields.io/github/issues-closed/oss2019/text-summarization.svg?style=flat-square)](https://github.com/oss2019/text-summarization/issues) [![Pull Requests](https://img.shields.io/github/issues-pr-closed/oss2019/text-summarization.svg?style=flat-square)](https://github.com/oss2019/text-summarization/pulls) [![License](https://img.shields.io/apm/l/vim-mode.svg?style=flat-square)](https://github.com/oss2019/text-summarization/blob/master/LICENSE) [![Gitter](https://img.shields.io/badge/chat-on%20gitter-ff006f.svg?style=flat-square)](https://gitter.im/oss2019/community) 4 | 5 | > ** Shorter text is always easier to read, isn't it!? ** 6 | 7 | An introductory course to ML where we'll together learn the Basics of Machine Learning, gain a solid foundation of the biologically-inspired programming paradigm 'Neural Networks' and utilize these to build a running Text_Summarization Model! 8 | 9 | ## Mentors: 10 | ``` 11 | Soma Siddhartha @sedherthe 12 | Ganesh Samarth @ganeshsamarth 13 | Prateek Jain @prateekjain2606 14 | ``` 15 | 16 | ## Estimated Time in weeks: 17 | 12 weeks 18 | 19 | ## Motivation: 20 | - To create a coherent and fluent summary having only the main points outlined in the document. 21 | - Biggest Incentive: Decrease in reading time! 22 | 23 | ## Features: 24 | - Given a longer document the program should create a short, accurate and fluent summary from the doc. 25 | - The Summary should also be comprehensive, coherent, readable, useful and most importantly trustworthy! 26 | -------------------------------------------------------------------------------- /readme_data_preprocessing.txt: -------------------------------------------------------------------------------- 1 | Task for data manipulation- 2 | We will now begin the process of text summarization- 3 | So first things first, the dataset. Since this is our first trial we will be using the amazon fine food reviews dataset to perform our summarization task 4 | You can find our implementation of the code in the repo 5 | https://github.com/ganeshsamarth/text_summarization_test.git 6 | 7 | Please find the dataset in the below mentioned link which has been hosted on kaggle. 8 | https://www.kaggle.com/snap/amazon-fine-food-reviews 9 | 10 | This will download the csv file on to your local machine. 11 | You will be using pandas to import this csv file into your python script. 12 | 13 | The first step to text summarization is dataset manipulation. We will be doing the following steps to make our data ready so as to feed it as input to our network. You might also want to use the regex library to work with your data. 14 | Here are the steps you will have to perform- 15 | 1. Open a python interpreter on your virtual environment and add the following command to download the stopwords in english from the nltk library. 16 | 17 | import nltk 18 | nltk.download('stopwords') 19 | 20 | 2.Now we begin the actual scripting- 21 | First import the csv file and run these commands- 22 | data=pd.read_csv("/home/pbu/Downloads/amazon-fine-food-reviews/Reviews.csv",nrows=100000) 23 | data.drop_duplicates(subset=['Text'],inplace=True)#dropping duplicates 24 | data.dropna(axis=0,inplace=True)#dropping na 25 | 26 | 3. Convert the text to lower case. 27 | 4. Use BeautifulSoup to append the article into one string using the lxml parser 28 | 5. Remove all punctuation marks i.e \([^)]*\) 29 | 6.Replace all contraction mappings with their longer forms (See reference i.e. the repo) 30 | 7. We want only letters in our dataset as of now, so we need to remove everything that is not in a-z. Try the negative character set. 31 | 7. Remove stopwords only for the main text and not the summary 32 | 8. Remove all short words (i.e words with length lesser than three). 33 | 34 | Take into consideration reviews and summaries which have the maximum word count to be 30 and 8 respectively. 35 | 36 | Add a start token and an end token to each of the summaries. 37 | Make sure the data is in the form of a dictionary. 38 | Print 3 examples each of reviews and summaries as the final output of your code. 39 | 40 | 41 | 42 | This ends the first part of the text summarization-the preprocesing. 43 | 44 | Next steps- 45 | Implement keras tokenizer 46 | Build the network 47 | Train the network 48 | Watch the magic! 49 | 50 | 51 | 52 | --------------------------------------------------------------------------------