ChaiBapchya commented on a change in pull request #13938: [MXNET-1291] solve 
pylint errors in examples with issue no.12205
URL: https://github.com/apache/incubator-mxnet/pull/13938#discussion_r249267723
 
 

 ##########
 File path: example/cnn_text_classification/data_helpers.py
 ##########
 @@ -111,23 +113,24 @@ def build_input_data(sentences, labels, vocabulary):
     y = np.array(labels)
     return [x, y]
 
-def build_input_data_with_word2vec(sentences, labels, word2vec):
+
+def build_input_data_with_word2vec(sentences, labels, word2vec_list):
     """Map sentences and labels to vectors based on a pretrained word2vec"""
     x_vec = []
     for sent in sentences:
         vec = []
         for word in sent:
-            if word in word2vec:
-                vec.append(word2vec[word])
+            if word in word2vec_list:
+                vec.append(word2vec_list[word])
             else:
-                vec.append(word2vec['</s>'])
+                vec.append(word2vec_list['</s>'])
         x_vec.append(vec)
     x_vec = np.array(x_vec)
     y_vec = np.array(labels)
     return [x_vec, y_vec]
 
 
-def load_data_with_word2vec(word2vec):
+def load_data_with_word2vec(word2vec_list):
     """
     Loads and preprocessed data for the MR dataset.
 
 Review comment:
   preprocesses

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to