INNER CODE UNIT · Java
prepare
mayabot/mynlp · mynlp-example/src/main/java/classification/HotelCommentExampleTrain.java:70
private static void prepare() throws Exception {
File trainFileSource = new File("example.data/hotel/hotel-train.txt");
File testFileSource = new File("example.data/hotel/hotel-test.txt");
trainFileSource.getParentFile().mkdirs();
if (!trainFileSource.exists()) {
File trainZipFile = new File("example.data/hotel/hotel-train.txt.zip");
File testZipFile = new File("example.data/hotel/hotel-test.txt.zip");
DownloadUtils.download("http://cdn.mayabot.com/nlp/hotel-train.txt.zip",
trainZipFile);
DownloadUtils.download("http://cdn.mayabot.com/nlp/hotel-test.txt.zip",
testZipFile);
DownloadUtils.unzip(trainZipFile);
DownloadUtils.unzip(testZipFile);
trainZipFile.delete();