Hello, Are you loading the model for each sentence or document to be parsed? If so, just load the model once and keep listening for parsing requests. Apart from that, parsing is a heavy task, and parsers in general are not lightning fast. Also, beware long sentences, the longer the sentences the slower the parsing.
HTH, R On Thu, Nov 12, 2015 at 3:39 AM, siping <[email protected]> wrote: > Hi - I'm using following code to parse a simple sentence: > InputStream chunkingStream = new FileInputStream("en-parser-chunking.bin"); > Parser parser = new ParserModel(chunkingStream); > String sentence = "Unfortunately, your service request does not include a > valid serial number that is required to service your issue."; > Parse[] parses = ParserTool.parseLine(sentence, parser, 1); > Using OpenNLP 2.6.0, Java 8, running this in a loop on a normal Linux server > with plenty memory, I find that the above ParserTool.parseLine() can take > 50-80ms. Does that sound normal? When you have thousands of documents, each > with hundreds of sentences, the delay adds up quickly. > Is there any way to speed it up? > thanks in advance.
