{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-09-23T08:10:43.108773Z","iopub.execute_input":"2022-09-23T08:10:43.109218Z","iopub.status.idle":"2022-09-23T08:10:43.139818Z","shell.execute_reply.started":"2022-09-23T08:10:43.109131Z","shell.execute_reply":"2022-09-23T08:10:43.138715Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dtypes = {\n    \"review_text\": str,\n    \"rating\": np.uint8,\n    \"review_id\": str\n}\n\ntrain_cols = ['review_text', 'rating']\ntest_cols = ['review_id', 'review_text']\n\ndf_train = pd.read_csv(\"../input/goodreads-books-reviews-290312/goodreads_train.csv\", usecols=train_cols, dtype=dtypes)\ndf_test = pd.read_csv(\"../input/goodreads-books-reviews-290312/goodreads_test.csv\", usecols=test_cols, dtype=dtypes)\n\nprint('train set size:', df_train.size)\nprint('test set size:', df_test.size)","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:10:48.058718Z","iopub.execute_input":"2022-09-23T08:10:48.059078Z","iopub.status.idle":"2022-09-23T08:11:20.487430Z","shell.execute_reply.started":"2022-09-23T08:10:48.059047Z","shell.execute_reply":"2022-09-23T08:11:20.485725Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train.info(memory_usage=\"deep\")","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:11:20.490012Z","iopub.execute_input":"2022-09-23T08:11:20.491042Z","iopub.status.idle":"2022-09-23T08:11:20.793688Z","shell.execute_reply.started":"2022-09-23T08:11:20.490998Z","shell.execute_reply":"2022-09-23T08:11:20.792706Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train['rating'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:11:20.795708Z","iopub.execute_input":"2022-09-23T08:11:20.796309Z","iopub.status.idle":"2022-09-23T08:11:20.812167Z","shell.execute_reply.started":"2022-09-23T08:11:20.796271Z","shell.execute_reply":"2022-09-23T08:11:20.810958Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"'''\nnew_train_df = pd.DataFrame(columns=df_train.columns.tolist())\nfor cat_name in pd.unique(df_train['rating']).tolist():\n    new_train_df = pd.concat([new_train_df, df_train.loc[df_train['rating'] == cat_name][ :28718]], axis=0)\n    \ndel df_train\n'''","metadata":{"execution":{"iopub.status.busy":"2022-09-23T07:25:54.950082Z","iopub.execute_input":"2022-09-23T07:25:54.950660Z","iopub.status.idle":"2022-09-23T07:25:55.144424Z","shell.execute_reply.started":"2022-09-23T07:25:54.950594Z","shell.execute_reply":"2022-09-23T07:25:55.143415Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"new_train_df = df_train\ndel df_train","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:11:26.011074Z","iopub.execute_input":"2022-09-23T08:11:26.011438Z","iopub.status.idle":"2022-09-23T08:11:26.015843Z","shell.execute_reply.started":"2022-09-23T08:11:26.011406Z","shell.execute_reply":"2022-09-23T08:11:26.014723Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"new_train_df['rating'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:11:29.252538Z","iopub.execute_input":"2022-09-23T08:11:29.253239Z","iopub.status.idle":"2022-09-23T08:11:29.268804Z","shell.execute_reply.started":"2022-09-23T08:11:29.253199Z","shell.execute_reply":"2022-09-23T08:11:29.267573Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import nltk\nnltk.download('stopwords')\nnltk.download('wordnet')\nnltk.download('omw-1.4')\nfrom nltk.stem.porter import PorterStemmer\nfrom nltk.stem import WordNetLemmatizer\nimport nltk\nnltk.download('words')\n\ndef preprocessing(text, wordnet_lemmatizer, translator):\n    text = text.translate(translator)\n    text = text.lower()\n    tokens = text.split()\n    stopwords = nltk.corpus.stopwords.words('english')\n    tokens = [i for i in tokens if i not in stopwords]\n    lemm_text = [wordnet_lemmatizer.lemmatize(word) for word in tokens]\n    return lemm_text","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:11:32.215825Z","iopub.execute_input":"2022-09-23T08:11:32.216752Z","iopub.status.idle":"2022-09-23T08:11:33.762005Z","shell.execute_reply.started":"2022-09-23T08:11:32.216709Z","shell.execute_reply":"2022-09-23T08:11:33.760752Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from nltk.stem.porter import PorterStemmer\nfrom nltk.stem import WordNetLemmatizer\nimport string\n\nporter_stemmer = PorterStemmer()\nwordnet_lemmatizer = WordNetLemmatizer()\ntranslator = str.maketrans(string.punctuation, ' '*len(string.punctuation))","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:11:35.676615Z","iopub.execute_input":"2022-09-23T08:11:35.677036Z","iopub.status.idle":"2022-09-23T08:11:35.683787Z","shell.execute_reply.started":"2022-09-23T08:11:35.677004Z","shell.execute_reply":"2022-09-23T08:11:35.682674Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"new_train_df['review_text'] = new_train_df['review_text'].apply(lambda x: preprocessing(x, wordnet_lemmatizer, translator))","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:11:37.374704Z","iopub.execute_input":"2022-09-23T08:11:37.375918Z","iopub.status.idle":"2022-09-23T08:26:02.108194Z","shell.execute_reply.started":"2022-09-23T08:11:37.375866Z","shell.execute_reply":"2022-09-23T08:26:02.107133Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"new_train_df.shape[0]","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:26:02.110425Z","iopub.execute_input":"2022-09-23T08:26:02.111363Z","iopub.status.idle":"2022-09-23T08:26:02.118808Z","shell.execute_reply.started":"2022-09-23T08:26:02.111332Z","shell.execute_reply":"2022-09-23T08:26:02.117615Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"new_train_df = new_train_df[new_train_df['review_text'].map(lambda rt: len(rt)) > 20]","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:26:02.120433Z","iopub.execute_input":"2022-09-23T08:26:02.121057Z","iopub.status.idle":"2022-09-23T08:26:02.894164Z","shell.execute_reply.started":"2022-09-23T08:26:02.121012Z","shell.execute_reply":"2022-09-23T08:26:02.893139Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_train = new_train_df['review_text'].values","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:26:02.897048Z","iopub.execute_input":"2022-09-23T08:26:02.897417Z","iopub.status.idle":"2022-09-23T08:26:02.904427Z","shell.execute_reply.started":"2022-09-23T08:26:02.897380Z","shell.execute_reply":"2022-09-23T08:26:02.903344Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_train.shape","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:26:02.906231Z","iopub.execute_input":"2022-09-23T08:26:02.906630Z","iopub.status.idle":"2022-09-23T08:26:02.914605Z","shell.execute_reply.started":"2022-09-23T08:26:02.906596Z","shell.execute_reply":"2022-09-23T08:26:02.913555Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from keras.preprocessing.text import Tokenizer\nfrom keras.preprocessing.sequence import pad_sequences\n\nn_most_common_words = 20000\nmax_len = 200\ntokenizer = Tokenizer(num_words=n_most_common_words)\ntokenizer.fit_on_texts(X_train)\nsequences = tokenizer.texts_to_sequences(X_train)\n\nX_train = pad_sequences(sequences, maxlen=max_len)","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:26:02.915858Z","iopub.execute_input":"2022-09-23T08:26:02.916301Z","iopub.status.idle":"2022-09-23T08:27:59.711993Z","shell.execute_reply.started":"2022-09-23T08:26:02.916267Z","shell.execute_reply":"2022-09-23T08:27:59.710889Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_train.shape","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:27:59.713520Z","iopub.execute_input":"2022-09-23T08:27:59.714441Z","iopub.status.idle":"2022-09-23T08:27:59.721204Z","shell.execute_reply.started":"2022-09-23T08:27:59.714399Z","shell.execute_reply":"2022-09-23T08:27:59.720090Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_train = new_train_df['rating'].values.tolist()","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:27:59.723003Z","iopub.execute_input":"2022-09-23T08:27:59.723393Z","iopub.status.idle":"2022-09-23T08:27:59.736636Z","shell.execute_reply.started":"2022-09-23T08:27:59.723339Z","shell.execute_reply":"2022-09-23T08:27:59.735587Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.preprocessing import LabelBinarizer\n\nunique_rating_categories = pd.unique(new_train_df['rating']).astype(np.uint8)\nlb = LabelBinarizer()\nlb.fit(unique_rating_categories)\ny_train = lb.transform(y_train)\ny_train.shape","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:27:59.738248Z","iopub.execute_input":"2022-09-23T08:27:59.738629Z","iopub.status.idle":"2022-09-23T08:27:59.993295Z","shell.execute_reply.started":"2022-09-23T08:27:59.738595Z","shell.execute_reply":"2022-09-23T08:27:59.992201Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras.layers import MultiHeadAttention, LayerNormalization, Dropout, Layer\nfrom tensorflow.keras.layers import Embedding, Input, GlobalAveragePooling1D, Dense\nfrom tensorflow.keras.datasets import imdb\nfrom tensorflow.keras.models import Sequential, Model\nimport numpy as np\nimport warnings\nwarnings.filterwarnings(\"ignore\", category=np.VisibleDeprecationWarning)","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:27:59.997486Z","iopub.execute_input":"2022-09-23T08:27:59.998492Z","iopub.status.idle":"2022-09-23T08:28:00.285827Z","shell.execute_reply.started":"2022-09-23T08:27:59.998462Z","shell.execute_reply":"2022-09-23T08:28:00.284869Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"class TransformerBlock(Layer):\n    def __init__(self, embed_dim, num_heads, ff_dim, rate=0.1):\n        super(TransformerBlock, self).__init__()\n        self.att = MultiHeadAttention(num_heads=num_heads, key_dim=embed_dim)\n        self.ffn = Sequential(\n            [Dense(ff_dim, activation=\"relu\"), \n             Dense(embed_dim),]\n        )\n        self.layernorm1 = LayerNormalization(epsilon=1e-6)\n        self.layernorm2 = LayerNormalization(epsilon=1e-6)\n        self.dropout1 = Dropout(rate)\n        self.dropout2 = Dropout(rate)\n\n    def call(self, inputs, training):\n        attn_output = self.att(inputs, inputs)\n        attn_output = self.dropout1(attn_output, training=training)\n        out1 = self.layernorm1(inputs + attn_output)\n        ffn_output = self.ffn(out1)\n        ffn_output = self.dropout2(ffn_output, training=training)\n        return self.layernorm2(out1 + ffn_output)","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:28:00.287530Z","iopub.execute_input":"2022-09-23T08:28:00.288210Z","iopub.status.idle":"2022-09-23T08:28:00.298243Z","shell.execute_reply.started":"2022-09-23T08:28:00.288171Z","shell.execute_reply":"2022-09-23T08:28:00.297299Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"class TokenAndPositionEmbedding(Layer):\n    def __init__(self, maxlen, vocab_size, embed_dim):\n        super(TokenAndPositionEmbedding, self).__init__()\n        self.token_emb = Embedding(input_dim=vocab_size, output_dim=embed_dim)\n        self.pos_emb = Embedding(input_dim=maxlen, output_dim=embed_dim)\n\n    def call(self, x):\n        maxlen = tf.shape(x)[-1]\n        positions = tf.range(start=0, limit=maxlen, delta=1)\n        positions = self.pos_emb(positions)\n        x = self.token_emb(x)\n        return x + positions","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:28:00.299986Z","iopub.execute_input":"2022-09-23T08:28:00.307490Z","iopub.status.idle":"2022-09-23T08:28:00.316482Z","shell.execute_reply.started":"2022-09-23T08:28:00.307461Z","shell.execute_reply":"2022-09-23T08:28:00.315520Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"vocab_size = 20000  # Only consider the top 20k words\nmaxlen = 200  # Only consider the first 200 words of each movie review\n\nembed_dim = 100  # Embedding size for each token\nnum_heads = 2  # Number of attention heads\nff_dim = 32  # Hidden layer size in feed forward network inside transformer\n\ninputs = Input(shape=(maxlen,))\nembedding_layer = TokenAndPositionEmbedding(maxlen, vocab_size, embed_dim)\nx = embedding_layer(inputs)\ntransformer_block = TransformerBlock(embed_dim, num_heads, ff_dim)\nx = transformer_block(x)\nx = GlobalAveragePooling1D()(x)\nx = Dropout(0.1)(x)\nx = Dense(20, activation=\"relu\")(x)\nx = Dropout(0.1)(x)\noutputs = Dense(6, activation=\"softmax\")(x)\n\nmodel = Model(inputs=inputs, outputs=outputs)","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:28:00.318318Z","iopub.execute_input":"2022-09-23T08:28:00.318802Z","iopub.status.idle":"2022-09-23T08:28:03.156335Z","shell.execute_reply.started":"2022-09-23T08:28:00.318754Z","shell.execute_reply":"2022-09-23T08:28:03.155360Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model.compile(optimizer=\"adam\", loss=\"categorical_crossentropy\", metrics=[\"accuracy\"])\n\nfrom keras.callbacks import EarlyStopping\nhistory = model.fit(X_train, y_train, \n                    batch_size=1024, epochs=100, \n                    validation_split=0.1,\n                    callbacks=[EarlyStopping(monitor='val_loss',patience=10, min_delta=0.0001)]\n                   )","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:28:03.157793Z","iopub.execute_input":"2022-09-23T08:28:03.158121Z","iopub.status.idle":"2022-09-23T08:46:49.850858Z","shell.execute_reply.started":"2022-09-23T08:28:03.158085Z","shell.execute_reply":"2022-09-23T08:46:49.849823Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# ploting train and validation metrics results throu training epochs\nimport matplotlib.pyplot as plt\n\nacc = history.history['accuracy']\nval_acc = history.history['val_accuracy']\nloss = history.history['loss']\nval_loss = history.history['val_loss']\n\nepochs = range(1, len(acc) + 1)\n\nplt.plot(epochs, acc, 'bo', label='Training acc')\nplt.plot(epochs, val_acc, 'b', label='Validation acc')\nplt.title('Training and validation accuracy')\nplt.legend()\n\nplt.figure()\n\nplt.plot(epochs, loss, 'bo', label='Training loss')\nplt.plot(epochs, val_loss, 'b', label='Validation loss')\nplt.title('Training and validation loss')\nplt.legend()\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:46:49.852751Z","iopub.execute_input":"2022-09-23T08:46:49.853113Z","iopub.status.idle":"2022-09-23T08:47:27.650761Z","shell.execute_reply.started":"2022-09-23T08:46:49.853078Z","shell.execute_reply":"2022-09-23T08:47:27.649800Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#df_test['review_text'] = df_test['review_text'].apply(lambda x: preprocessing(x, wordnet_lemmatizer, translator))","metadata":{"execution":{"iopub.status.busy":"2022-09-23T07:51:28.689979Z","iopub.execute_input":"2022-09-23T07:51:28.690753Z","iopub.status.idle":"2022-09-23T07:59:20.005226Z","shell.execute_reply.started":"2022-09-23T07:51:28.690660Z","shell.execute_reply":"2022-09-23T07:59:20.003843Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_test = pd.read_csv(\"../input/goodreads-books-reviews-290312/goodreads_test.csv\", usecols=test_cols, dtype=dtypes)","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:47:27.652052Z","iopub.execute_input":"2022-09-23T08:47:27.652864Z","iopub.status.idle":"2022-09-23T08:47:32.353706Z","shell.execute_reply.started":"2022-09-23T08:47:27.652824Z","shell.execute_reply":"2022-09-23T08:47:32.352584Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_test = df_test['review_text'].values","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:47:32.355151Z","iopub.execute_input":"2022-09-23T08:47:32.355616Z","iopub.status.idle":"2022-09-23T08:47:32.361386Z","shell.execute_reply.started":"2022-09-23T08:47:32.355575Z","shell.execute_reply":"2022-09-23T08:47:32.360301Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"n_most_common_words = 20000\nmax_len = 200\ntokenizer = Tokenizer(num_words=n_most_common_words,\n                      filters='1234567890!\"#$%&()*+,-./:;<=>?@[\\]^_`{|}~', lower=True)\ntokenizer.fit_on_texts(X_test)\nsequences = tokenizer.texts_to_sequences(X_test)\n\nX_test = pad_sequences(sequences, maxlen=max_len)","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:47:32.363232Z","iopub.execute_input":"2022-09-23T08:47:32.363701Z","iopub.status.idle":"2022-09-23T08:49:35.377024Z","shell.execute_reply.started":"2022-09-23T08:47:32.363624Z","shell.execute_reply":"2022-09-23T08:49:35.375829Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_test.shape","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:49:35.378605Z","iopub.execute_input":"2022-09-23T08:49:35.379011Z","iopub.status.idle":"2022-09-23T08:49:35.386152Z","shell.execute_reply.started":"2022-09-23T08:49:35.378973Z","shell.execute_reply":"2022-09-23T08:49:35.385006Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_pred = model.predict(X_test)\ny_pred = np.argmax(y_pred, axis=1)","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:49:35.387914Z","iopub.execute_input":"2022-09-23T08:49:35.388298Z","iopub.status.idle":"2022-09-23T08:50:21.595352Z","shell.execute_reply.started":"2022-09-23T08:49:35.388261Z","shell.execute_reply":"2022-09-23T08:50:21.593716Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_test[\"rating\"] = y_pred\ndf_test[[\"review_id\", \"rating\"]].to_csv(\"submission.csv\", index=False)","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:50:21.597182Z","iopub.execute_input":"2022-09-23T08:50:21.597913Z","iopub.status.idle":"2022-09-23T08:50:22.210696Z","shell.execute_reply.started":"2022-09-23T08:50:21.597874Z","shell.execute_reply":"2022-09-23T08:50:22.209700Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from IPython.display import HTML\nimport pandas as pd\nimport numpy as np\nimport base64\n\n# function that takes in a dataframe and creates a text link to  \n# download it (will only work for files < 2MB or so)\ndef create_download_link(df, title = \"Download CSV file\", filename = \"submission.csv\"):  \n    csv = df.to_csv(index=False)\n    b64 = base64.b64encode(csv.encode())\n    payload = b64.decode()\n    html = '<a download=\"{filename}\" href=\"data:text/csv;base64,{payload}\" target=\"_blank\">{title}</a>'\n    html = html.format(payload=payload,title=title,filename=filename)\n    return HTML(html)","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:50:22.212218Z","iopub.execute_input":"2022-09-23T08:50:22.212568Z","iopub.status.idle":"2022-09-23T08:50:22.220273Z","shell.execute_reply.started":"2022-09-23T08:50:22.212531Z","shell.execute_reply":"2022-09-23T08:50:22.219329Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"create_download_link(df_test[[\"review_id\", \"rating\"]])","metadata":{"execution":{"iopub.status.busy":"2022-09-23T08:50:22.221625Z","iopub.execute_input":"2022-09-23T08:50:22.222849Z","iopub.status.idle":"2022-09-23T08:50:23.745572Z","shell.execute_reply.started":"2022-09-23T08:50:22.222812Z","shell.execute_reply":"2022-09-23T08:50:23.744115Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}