Skip to content

Commit

Permalink
Update DatasetCreator.java
Browse files Browse the repository at this point in the history
added fraud detection plugin
  • Loading branch information
Manos Chatzakis committed Jan 7, 2022
1 parent 4ad1d5f commit e936ceb
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions RDFsim/src/main/java/scripts/DatasetCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,53 @@ public static void createVideoGamesDataset() throws IOException {
System.out.println("Raf: " + elapsedTimeRaf);
}

public static void createFraudDetectionDataset() throws IOException {
long start;
long end;

System.out.println(" \n================ Creating Video Games Dataset ================\n ");

String rafTargetPath = "C:\\temp\\FraudDetection.txt";
String txtSourcePath = "C:\\tmp\\rdfsim\\FraudDetection.txt";
String vecTargetPath = "C:\\tmp\\rdfsim\\embeddings\\FraudDetection.vec";

int count = 30;

start = System.currentTimeMillis();
Word2vecAPI vec = trainModel(vecTargetPath, txtSourcePath, false);
end = System.currentTimeMillis();
double elapsedTimeTrain = (end - start) * 1.0 / 1000.0;

start = System.currentTimeMillis();
//defaultDatasetCleanUp(vec);

Collection<String> keepWordsNotStartingWith = new ArrayList<>();
keepWordsNotStartingWith.add("link:");
Collection<String> removeWordsContaining = new ArrayList<>();
removeWordsContaining.add("?");
removeWordsContaining.add("-");
removeWordsContaining.add("(address)");


vec.filterVocab(null, keepWordsNotStartingWith, removeWordsContaining);

String ptrTargetPath = rafTargetPath.replace(".txt", "PTR.txt");
vec.createRAF(rafTargetPath, ptrTargetPath, count);
end = System.currentTimeMillis();
double elapsedTimeRaf = (end - start) * 1.0 / 1000.0;

System.out.println("FraudDetection: ");
System.out.println("Train: " + elapsedTimeTrain);
System.out.println("Raf: " + elapsedTimeRaf);
}

public static void main(String[] args) throws IOException {

//createPhilosophersDataset();

//createProgrammingLanguagesDataset();
createMoviesDataset();
//createMoviesDataset();
//createVideoGamesDataset();
createFraudDetectionDataset();
}



}

0 comments on commit e936ceb

Please sign in to comment.