use of org.deeplearning4j.spark.models.paragraphvectors.functions.DocumentSequenceConvertFunction in project deeplearning4j by deeplearning4j.
the class SparkParagraphVectors method fitLabelledDocuments.
/**
* This method builds ParagraphVectors model, expecting JavaRDD<LabelledDocument>.
* It can be either non-tokenized documents, or tokenized.
*
* @param documentsRdd
*/
public void fitLabelledDocuments(JavaRDD<LabelledDocument> documentsRdd) {
validateConfiguration();
broadcastEnvironment(new JavaSparkContext(documentsRdd.context()));
JavaRDD<Sequence<VocabWord>> sequenceRDD = documentsRdd.map(new DocumentSequenceConvertFunction(configurationBroadcast));
super.fitSequences(sequenceRDD);
}
Aggregations