Skip navigation.
Semantic Software Lab
Concordia University
Montréal, Canada

Error using with PAX using NPE

Printer-friendly versionPrinter-friendly versionPDF versionPDF version


I am getting the following error in GATE:

extracting np PAS!
java.lang.ClassCastException: gate.corpora.DocumentContentImpl cannot be cast to java.lang.String
at info.semanticsoftware.multiPaX.NpParserPaX.getPAS(
at info.semanticsoftware.multiPaX.MultiPaX.execute(
at gate.util.Benchmark.executeWithBenchmarking(
at gate.creole.SerialController.runComponent(
at gate.creole.SerialController.executeImpl(
at gate.creole.SerialAnalyserController.executeImpl(
at gate.creole.AbstractController.execute(
at gate.util.Benchmark.executeWithBenchmarking(
at gate.gui.SerialControllerEditor$RunAction$

I have PAX using the "np" NPE Ann Set with both its input and output Ann Sets blank. PAX works fine with "stanford". Any clue as to what the problem is?

- Q

rene's picture

Try patching MuNPEx

The version of MuNPEx used in the PAX release is newer than the one on this website. I'll update it sometime this summer, but for a quick fix patch the following lines in the MuNPEx release by adding "toString()" as shown below:

de-lemma.jape:String npLemma = (String)npAnn.getFeatures().get( "HEAD" ).toString();

en-lemma.jape:String npLemma = (String)npAnn.getFeatures().get( "HEAD" ).toString();

np.jape:    features.put( "HEAD", doc.getContent().getContent( headAnn.getStartNode().getOffset(), headAnn.getEndNode().getOffset() ).toString());

np.jape:        features.put( "MOD", doc.getContent().getContent( modStart, modEnd ).toString() );

np.jape:        features.put( "DET", doc.getContent().getContent( detAnn.getStartNode().getOffset(), detAnn.getEndNode().getOffset() ).toString());

np.jape:        features.put( "MOD2", doc.getContent().getContent( mod2Ann.getStartNode().getOffset(), mod2Ann.getEndNode().getOffset() ).toString());

Fixed by new MuNPEx release

With any newer MuNPEx version (1.0 and up) this problem should not appear anymore.