lewismc commented on a change in pull request #7: SDAP-35 Overhaul MUDROD configuration URL: https://github.com/apache/incubator-sdap-mudrod/pull/7#discussion_r173493660
########## File path: core/src/main/java/org/apache/sdap/mudrod/recommendation/pre/MetadataTFIDFGenerator.java ########## @@ -70,35 +72,35 @@ public Object execute(Object o) { public LabeledRowMatrix generateWordBasedTFIDF() throws Exception { - MetadataOpt opt = new MetadataOpt(props); + MetadataTokenizer opt = new MetadataTokenizer(props); - JavaPairRDD<String, String> metadataContents = opt.loadAll(es, spark); + String metadataName = props.getProperty(MudrodConstants.METADATA_ID); + JavaPairRDD<String, String> metadataContents = opt.loadAll(es, spark, metadataName); JavaPairRDD<String, List<String>> metadataWords = opt.tokenizeData(metadataContents, " "); LabeledRowMatrix wordtfidfMatrix = opt.tFIDFTokens(metadataWords, spark); - MatrixUtil.exportToCSV(wordtfidfMatrix.rowMatrix, wordtfidfMatrix.rowkeys, wordtfidfMatrix.colkeys, props.getProperty("metadata_word_tfidf_matrix")); + MatrixUtil.exportToCSV(wordtfidfMatrix.rowMatrix, wordtfidfMatrix.rowkeys, wordtfidfMatrix.colkeys, props.getProperty(MudrodConstants.METADATA_WORD_MATRIX_PATH)); return wordtfidfMatrix; } public LabeledRowMatrix generateTermBasedTFIDF() throws Exception { - MetadataOpt opt = new MetadataOpt(props); + MetadataTokenizer opt = new MetadataTokenizer(props); - List<String> variables = new ArrayList<>(); - variables.add("DatasetParameter-Term"); - variables.add("DatasetParameter-Variable"); - variables.add("Dataset-ExtractTerm"); + String source = props.getProperty(MudrodConstants.SEMANTIC_FIELDS); + List<String> variables = new ArrayList<String>(Arrays.asList(source.split(","))); Review comment: Use diamond operator on right hand side ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services