Trdjocmooesvpsp
New Member
I just implemented Standford post tagger in Java. I gave few kb of file size which consists of few hundred words. I even set the heap size to 600m. But still it is slow or sometimes heap run out of memory. Just give me how to increase my execution speed and increase my program performance or any modifications for my program? I want to give few mb of words to be tagged.\[code\] public static void postag(String args) throws ClassNotFoundException { try { File filein=new File("c://input.txt"); String content = FileUtils.readFileToString(filein); MaxentTagger tagger = new MaxentTagger("postagging/wsj-0-18-bidirectional-distsim.tagger"); String tagged = tagger.tagString(content); try { File file = new File("c://output.txt"); if (!file.exists()) { file.createNewFile(); } FileWriter fw = new FileWriter(file.getAbsoluteFile()); BufferedWriter bw = new BufferedWriter(fw); bw.write("\n"+tagged); bw.close(); } catch (IOException e) { e.printStackTrace(); } } catch (IOException e1) { e1.printStackTrace(); } }\[/code\]