class_docstr: Dataset for NP Semantic Segmentation Model
  
      Args:
          file_path (str): read data from this local file path
  
          train_to_test_ratio (:obj:`float`): the train-to-test ration of the dataset
  
          feature_vec_dim (:obj:`int`): the size of the feature vector for each noun-phrase
docstr: Loads data from file_path to X_train, y_train, X_test, y_test numpy arrays
  
  Returns:
      tuple(:obj:`np.ndarray`): X_train, y_train, X_test, y_test numpy arrays
docstr_tok: ["Loads","data","from","file_path","to","X_train",",","y_train",",","X_test",",","y_test","numpy","arrays","Returns",":","tuple","(",":","obj",":","`","np.ndarray","`",")",":","X_train",",","y_train",",","X_test",",","y_test","numpy","arrays"]
code: def load_data_from_file(self):
      """
      Loads data from file_path to X_train, y_train, X_test, y_test numpy arrays
  
      Returns:
          tuple(:obj:`np.ndarray`): X_train, y_train, X_test, y_test numpy arrays
      """
      reader_list = read_csv_file_data(self.file_path)
      # count num of feature vectors
      num_feats = len(reader_list)
      # is_y_labels is for inference - if the inference data is labeled y_labels are extracted
      self.is_y_labels = len(reader_list[0]) == self.feature_vec_dim + 1
      X_feature_matrix = numpy.zeros((num_feats, self.feature_vec_dim))
      Y_labels_vec = []
      cntr = 0
      for line in reader_list:
          X_features = numpy.array(line[: self.feature_vec_dim])
          X_feature_matrix[cntr, :] = X_features
  
          if self.is_y_labels:
              Y_label = line[self.feature_vec_dim]
              Y_labels_vec.insert(cntr, Y_label)
          cntr += 1
  
      len_train = int(math.floor(num_feats * self.train_to_test_ratio))
  
      X_train = X_feature_matrix[0 : len_train - 1]
      y_train = None
      if self.is_y_labels:
          y_train = Y_labels_vec[0 : len_train - 1]
          y_train = numpy.array(y_train, dtype=numpy.int32)
  
      X_test = X_feature_matrix[len_train:]
      y_test = None
      if self.is_y_labels:
          y_test = Y_labels_vec[len_train:]
          y_test = numpy.array(y_test, dtype=numpy.int32)
      return X_train, y_train, X_test, y_test
  
imports: import argparse
  import csv
  import math
  import os
  from multiprocessing import Pool
  import feature_extraction
  import numpy
  from tqdm import tqdm
  from nlp_architect.utils.io import validate_existing_filepath, validate_parent_exists, validate_proxy_path
label_desc: Use image node_id 2 for calling the NpSemanticSegData obj's underlying member method code with example usage: obj.load_data_from_file() and returns: X_train,  y_train,  X_test,  y_test