[{'role': 'system', 'content': "You are an expert in machine learning and your task is to classify the code snippets into categories from the provided list of categories. List of categories: ['helper_functions', 'load_data', 'data_exploration', 'data_preprocessing', 'evaluation', 'modelling', 'prediction', 'result_visualization', 'save_results', 'comment_only']"}, {'role': 'user', 'content': 'Identify to which category the provided code belongs and assign the code snippet to at least 1 but up to 5 categories based on the probabilities, ignore if the probability of the category is negligible. Strictly provide your response as a list. Avoid providing any additional information, commentary, or personal opinions.\\nPython Code:import time\nimport sys\nclass SentimentNetwork:\ndef __init__(self, reviews,labels,hidden_nodes = 10, learning_rate = 0.1):\nnp.random.seed(1)\nself.pre_process_data(reviews)\nself.init_network(len(self.review_vocab),hidden_nodes, 1, learning_rate)\ndef pre_process_data(self,reviews):\nreview_vocab = set()\nfor review in reviews:\nfor word in review.split(" "):\nreview_vocab.add(word)\nself.review_vocab = list(review_vocab)\nlabel_vocab = set()\nfor label in labels:\nlabel_vocab.add(label)\nself.label_vocab = list(label_vocab)\nself.review_vocab_size = len(self.review_vocab)\nself.label_vocab_size = len(self.label_vocab)\nself.word2index = {}\nfor i, word in enumerate(self.review_vocab):\nself.word2index[word] = i\nself.label2index = {}\nfor i, label in enumerate(self.label_vocab):\nself.label2index[label] = i\ndef init_network(self, input_nodes, hidden_nodes, output_nodes, learning_rate):\nself.input_nodes = input_nodes\nself.hidden_nodes = hidden_nodes\nself.output_nodes = output_nodes\nself.weights_0_1 = np.zeros((self.input_nodes,self.hidden_nodes))\nself.weights_1_2 = np.random.normal(0.0, self.output_nodes**-0.5,\n(self.hidden_nodes, self.output_nodes))\nself.learning_rate = learning_rate\nself.layer_0 = np.zeros((1,input_nodes))\nself.layer_1 = np.zeros((1,hidden_nodes))\ndef sigmoid(self,x):\nreturn 1 / (1 + np.exp(-x))\ndef sigmoid_output_2_derivative(self,output):\nreturn output * (1 - output)\ndef update_input_layer(self,review):\nself.layer_0 *= 0\nfor word in review.split(" "):\nself.layer_0[0][self.word2index[word]] = 1\ndef get_target_for_label(self,label):\nif(label == \'POSITIVE\'):\nreturn 1\nelse:\nreturn 0\ndef train(self, training_reviews_raw, training_labels):\ntraining_reviews = list()\nfor review in training_reviews_raw:\nindices = set()\nfor word in review.split(" "):\nif(word in self.word2index.keys()):\nindices.add(self.word2index[word])\ntraining_reviews.append(list(indices))\nassert(len(training_reviews) == len(training_labels))\ncorrect_so_far = 0\nstart = time.time()\nfor i in range(len(training_reviews)):\nreview = training_reviews[i]\nlabel = training_labels[i]\nself.layer_1 *= 0\nfor index in review:\nself.layer_1 += self.weights_0_1[index]\nlayer_2 = self.sigmoid(self.layer_1.dot(self.weights_1_2))\nlayer_2_error = layer_2 - self.get_target_for_label(label) # Output layer error is the difference between desired target and actual output.\nlayer_2_delta = layer_2_error * self.sigmoid_output_2_derivative(layer_2)\nlayer_1_error = layer_2_delta.dot(self.weights_1_2.T) # errors propagated to the hidden layer\nlayer_1_delta = layer_1_error # hidden layer gradients - no nonlinearity so it\'s the same as the error\nself.weights_1_2 -= self.layer_1.T.dot(layer_2_delta) * self.learning_rate # update hidden-to-output weights with gradient descent step\nfor index in review:\nself.weights_0_1[index] -= layer_1_delta[0] * self.learning_rate # update input-to-hidden weights with gradient descent step\nif(np.abs(layer_2_error) < 0.5):\ncorrect_so_far += 1\nreviews_per_second = i / float(time.time() - start)\nsys.stdout.write("\\rProgress:" + str(100 * i/float(len(training_reviews)))[:4] + "% Speed(reviews/sec):" + str(reviews_per_second)[0:5] + " #Correct:" + str(correct_so_far) + " #Trained:" + str(i+1) + " Training Accuracy:" + str(correct_so_far * 100 / float(i+1))[:4] + "%")\ndef test(self, testing_reviews, testing_labels):\ncorrect = 0\nstart = time.time()\nfor i in range(len(testing_reviews)):\npred = self.run(testing_reviews[i])\nif(pred == testing_labels[i]):\ncorrect += 1\nreviews_per_second = i / float(time.time() - start)\nsys.stdout.write("\\rProgress:" + str(100 * i/float(len(testing_reviews)))[:4] \\\n+ "% Speed(reviews/sec):" + str(reviews_per_second)[0:5] \\\n+ "% #Correct:" + str(correct) + " #Tested:" + str(i+1) + " Testing Accuracy:" + str(correct * 100 / float(i+1))[:4] + "%")\ndef run(self, review):\nself.layer_1 *= 0\nunique_indices = set()\nfor word in review.lower().split(" "):\nif word in self.word2index.keys():\nunique_indices.add(self.word2index[word])\nfor index in unique_indices:\nself.layer_1 += self.weights_0_1[index]\nlayer_2 = self.sigmoid(self.layer_1.dot(self.weights_1_2))\nif(layer_2[0] > 0.5):\nreturn "POSITIVE"\nelse:\nreturn "NEGATIVE"'}, {'role': 'assistant', 'content': "['helper_functions', 'evaluation', 'modelling', 'prediction']"}]