I am trying to add sentiment analysis program written in deeplearning4j
to Spark pipeline. Then I have to override the method org.apache.spark.ml.PredictionModel. predict()
to predict using the RNN
model I created. As I understood, the arguments to this method is a feature row and the label for the row is predicted. But, in sentiment analysis program, the features should be a 2D array because each row contains a list of list of vectors as [[0.0011181544391649161,0.0025584171060651644,0.01754946247376411,-0.006530340570481004,0.003487414946750136,0.004426218948032432,0.00404,0.002611281607120172,0.006444432718879956,-0.012260229877306768,0.002399729592556043]]
But I get a 1D array as[0.003356837383,0.0074654373,...]
as the input of predict method. Can you explain why this happens and can you explain the what are the arguments to the predict method?