stanford-oval / sempre

OBSOLETE. The Old Almond parser
Other
0 stars 1 forks source link

ThingpediaLexiconFn broke the parser #6

Closed rakeshr1 closed 8 years ago

rakeshr1 commented 8 years ago

Parser.parse: parse { ERROR: Composition failed: rule = $Help -> $PHRASE (IdentityFn), children = [(derivation (formula (string help)) (type fb:type.text))] java.lang.NullPointerException at edu.stanford.nlp.io.IOUtils.readLines(IOUtils.java:494) at edu.stanford.nlp.sempre.overnight.Aligner.read(Aligner.java:98) at edu.stanford.nlp.sempre.overnight.OvernightFeatureComputer.buildLexicalAlignmentMatrix(OvernightFeatureComputer.java:421) at edu.stanford.nlp.sempre.overnight.OvernightFeatureComputer.extractLexicalFeatures(OvernightFeatureComputer.java:333) at edu.stanford.nlp.sempre.overnight.OvernightFeatureComputer.extractLocal(OvernightFeatureComputer.java:83) at edu.stanford.nlp.sempre.FeatureExtractor.extractLocal(FeatureExtractor.java:71) at edu.stanford.nlp.sempre.ParserState.featurizeAndScoreDerivation(ParserState.java:77) at edu.stanford.nlp.sempre.BeamParserState.applyRule(BeamParser.java:162) at edu.stanford.nlp.sempre.BeamParserState.applyCatUnaryRules(BeamParser.java:209) at edu.stanford.nlp.sempre.BeamParserState.build(BeamParser.java:141) at edu.stanford.nlp.sempre.BeamParserState.infer(BeamParser.java:113) at edu.stanford.nlp.sempre.Parser.parse(Parser.java:159) at edu.stanford.nlp.sempre.Master.handleUtterance(Master.java:229) at edu.stanford.nlp.sempre.Master.processQuery(Master.java:183) at edu.stanford.nlp.sempre.Master.runInteractivePrompt(Master.java:148) at edu.stanford.nlp.sempre.Main.run(Main.java:39) at fig.exec.Execution.runWithObjArray(Execution.java:337) at fig.exec.Execution.run(Execution.java:325) at edu.stanford.nlp.sempre.Main.main(Main.java:51) } java.lang.RuntimeException: java.lang.NullPointerException at edu.stanford.nlp.sempre.BeamParserState.applyRule(BeamParser.java:181) at edu.stanford.nlp.sempre.BeamParserState.applyCatUnaryRules(BeamParser.java:209) at edu.stanford.nlp.sempre.BeamParserState.build(BeamParser.java:141) at edu.stanford.nlp.sempre.BeamParserState.infer(BeamParser.java:113) at edu.stanford.nlp.sempre.Parser.parse(Parser.java:159) at edu.stanford.nlp.sempre.Master.handleUtterance(Master.java:229) at edu.stanford.nlp.sempre.Master.processQuery(Master.java:183) at edu.stanford.nlp.sempre.Master.runInteractivePrompt(Master.java:148) at edu.stanford.nlp.sempre.Main.run(Main.java:39) at fig.exec.Execution.runWithObjArray(Execution.java:337) at fig.exec.Execution.run(Execution.java:325) at edu.stanford.nlp.sempre.Main.main(Main.java:51) Caused by: java.lang.NullPointerException at edu.stanford.nlp.io.IOUtils.readLines(IOUtils.java:494) at edu.stanford.nlp.sempre.overnight.Aligner.read(Aligner.java:98) at edu.stanford.nlp.sempre.overnight.OvernightFeatureComputer.buildLexicalAlignmentMatrix(OvernightFeatureComputer.java:421) at edu.stanford.nlp.sempre.overnight.OvernightFeatureComputer.extractLexicalFeatures(OvernightFeatureComputer.java:333) at edu.stanford.nlp.sempre.overnight.OvernightFeatureComputer.extractLocal(OvernightFeatureComputer.java:83) at edu.stanford.nlp.sempre.FeatureExtractor.extractLocal(FeatureExtractor.java:71) at edu.stanford.nlp.sempre.ParserState.featurizeAndScoreDerivation(ParserState.java:77) at edu.stanford.nlp.sempre.BeamParserState.applyRule(BeamParser.java:162) ... 11 more

The grammar used for the above was simple:

(rule $Help ($PHRASE) (IdentityFn) (anchored 1.0)) (rule $Command ($Help) (JoinFn betaReduce forward (arg0 (lambda value (call edu.stanford.nlp.sempre.thingtalk.ThingTalk.cmdForm (string help) (var value)))))) (rule $Special ($PHRASE) (SimpleLexiconFn (type tt:type.special))) (rule $ROOT ($Command) (JoinFn betaReduce forward (arg0 (lambda cmd (call edu.stanford.nlp.sempre.thingtalk.ThingTalk.jsonOut (var cmd)))))) (rule $ROOT ($Special) (JoinFn betaReduce forward (arg0 (lambda spl (call edu.stanford.nlp.sempre.thingtalk.ThingTalk.special (var spl))))))

gcampax commented 8 years ago

This error is on your side, your missing a command line argument pointing to the aligner files

rakeshr1 commented 8 years ago

Resolved. Needed to add empty alignment, ppdb files for the overnight stuff to work