@Override public void init() { buildContextGenerator = new BuildContextGenerator(); attachContextGenerator = new AttachContextGenerator(punctSet); checkContextGenerator = new CheckContextGenerator(punctSet); }
Collection<Parse> punct1s = p0.getNextPunctuationSet(); String consfp = cons(fp, -3); String consf = cons(fn, -2); String consp_1 = cons(p_1, -1); String consp0 = cons(p0, 0); String consp1 = cons(p1, 1); String consbofp = consbo(fp, -3); String consbof = consbo(fn, -2); String consbop_1 = consbo(p_1, -1); String consbop0 = consbo(p0, 0); String consbop1 = consbo(p1, 1); String prod = production(fn,false); cons2(features,cfp,c0,punct_1s,true); cons2(features,cf,c0,punct_1s,true); cons2(features,c_1,c0,punct_1s,true); cons2(features,c0,c1,punct1s,true); cons3(features,cf,c_1,c0,null,punct_1s,true,true,true); cons3(features,cf,c0,c1,punct_1s,punct1s,true,true,true); cons3(features,cfp,cf,c0,null,punct_1s,true,true,true); if (containsPunct(punct_1s,"''")) { if (containsPunct(punct_1fs,"``")) { features.add("quotematch");//? not generating feature correctly
public String[] getContext(Object o) { Object[] parts = (Object[]) o; return getContext((Parse[]) parts[0], (Integer) parts[1],(List<Parse>) parts[2], (Integer) parts[3]); }
Collection<Parse> punct1s = p0.getNextPunctuationSet(); String consfp = cons(fp, -3); String consf = cons(fn, -2); String consp_1 = cons(p_1, -1); String consp0 = cons(p0, 0); String consp1 = cons(p1, 1); String consbofp = consbo(fp, -3); String consbof = consbo(fn, -2); String consbop_1 = consbo(p_1, -1); String consbop0 = consbo(p0, 0); String consbop1 = consbo(p1, 1); String prod = production(fn,false); cons2(features,cfp,c0,punct_1s,true); cons2(features,cf,c0,punct_1s,true); cons2(features,c_1,c0,punct_1s,true); cons2(features,c0,c1,punct1s,true); cons3(features,cf,c_1,c0,null,punct_1s,true,true,true); cons3(features,cf,c0,c1,punct_1s,punct1s,true,true,true); cons3(features,cfp,cf,c0,null,punct_1s,true,true,true); if (containsPunct(punct_1s,"''")) { if (containsPunct(punct_1fs,"``")) { features.add("quotematch");//? not generating feature correctly
public String[] getContext(Object o) { Object[] parts = (Object[]) o; return getContext((Parse[]) parts[0], (Integer) parts[1],(List<Parse>) parts[2], (Integer) parts[3]); }
private Parser(MaxentModel buildModel, MaxentModel attachModel, MaxentModel checkModel, POSTagger tagger, Chunker chunker, HeadRules headRules, int beamSize, double advancePercentage) { super(tagger,chunker,headRules,beamSize,advancePercentage); this.buildModel = buildModel; this.attachModel = attachModel; this.checkModel = checkModel; this.buildContextGenerator = new BuildContextGenerator(); this.attachContextGenerator = new AttachContextGenerator(punctSet); this.checkContextGenerator = new CheckContextGenerator(punctSet); this.bprobs = new double[buildModel.getNumOutcomes()]; this.aprobs = new double[attachModel.getNumOutcomes()]; this.cprobs = new double[checkModel.getNumOutcomes()]; this.doneIndex = buildModel.getIndex(DONE); this.sisterAttachIndex = attachModel.getIndex(ATTACH_SISTER); this.daughterAttachIndex = attachModel.getIndex(ATTACH_DAUGHTER); this.nonAttachIndex = attachModel.getIndex(NON_ATTACH); attachments = new int[] {daughterAttachIndex,sisterAttachIndex}; this.completeIndex = checkModel.getIndex(Parser.COMPLETE); }
Collection<Parse> punct1s = p0.getNextPunctuationSet(); String consfp = cons(fp, -3); String consf = cons(fn, -2); String consp_1 = cons(p_1, -1); String consp0 = cons(p0, 0); String consp1 = cons(p1, 1); String consbofp = consbo(fp, -3); String consbof = consbo(fn, -2); String consbop_1 = consbo(p_1, -1); String consbop0 = consbo(p0, 0); String consbop1 = consbo(p1, 1); String prod = production(fn,false); cons2(features,cfp,c0,punct_1s,true); cons2(features,cf,c0,punct_1s,true); cons2(features,c_1,c0,punct_1s,true); cons2(features,c0,c1,punct1s,true); cons3(features,cf,c_1,c0,null,punct_1s,true,true,true); cons3(features,cf,c0,c1,punct_1s,punct1s,true,true,true); cons3(features,cfp,cf,c0,null,punct_1s,true,true,true); if (containsPunct(punct_1s,"''")) { if (containsPunct(punct_1fs,"``")) { features.add("quotematch");//? not generating feature correctly
public String[] getContext(Object o) { Object[] parts = (Object[]) o; return getContext((Parse[]) parts[0], (Integer) parts[1],(List<Parse>) parts[2], (Integer) parts[3]); }
@Override public void init() { buildContextGenerator = new BuildContextGenerator(); attachContextGenerator = new AttachContextGenerator(punctSet); checkContextGenerator = new CheckContextGenerator(punctSet); }
attachNode = cfn; if (etype == ParserEventTypeEnum.ATTACH) { parseEvents.add(new Event(attachType, attachContextGenerator.getContext(currentChunks, ci, currentRightFrontier, attachNodeIndex))); if (etype == ParserEventTypeEnum.ATTACH) { parseEvents.add(new Event(Parser.ATTACH_SISTER, attachContextGenerator.getContext(currentChunks, ci, currentRightFrontier, cfi))); if (etype == ParserEventTypeEnum.ATTACH) { parseEvents.add(new Event(Parser.NON_ATTACH, attachContextGenerator.getContext(currentChunks, ci, currentRightFrontier, cfi)));
@Override public void init() { buildContextGenerator = new BuildContextGenerator(); attachContextGenerator = new AttachContextGenerator(punctSet); checkContextGenerator = new CheckContextGenerator(punctSet); }
for (int fi = 0,fs = rf.size(); fi < fs; fi++) { Parse fn = rf.get(fi); attachModel.eval(attachContextGenerator.getContext(children, advanceNodeIndex, rf, fi), aprobs); if (debugOn) {
private Parser(MaxentModel buildModel, MaxentModel attachModel, MaxentModel checkModel, POSTagger tagger, Chunker chunker, HeadRules headRules, int beamSize, double advancePercentage) { super(tagger,chunker,headRules,beamSize,advancePercentage); this.buildModel = buildModel; this.attachModel = attachModel; this.checkModel = checkModel; this.buildContextGenerator = new BuildContextGenerator(); this.attachContextGenerator = new AttachContextGenerator(punctSet); this.checkContextGenerator = new CheckContextGenerator(punctSet); this.bprobs = new double[buildModel.getNumOutcomes()]; this.aprobs = new double[attachModel.getNumOutcomes()]; this.cprobs = new double[checkModel.getNumOutcomes()]; this.doneIndex = buildModel.getIndex(DONE); this.sisterAttachIndex = attachModel.getIndex(ATTACH_SISTER); this.daughterAttachIndex = attachModel.getIndex(ATTACH_DAUGHTER); this.nonAttachIndex = attachModel.getIndex(NON_ATTACH); attachments = new int[] {daughterAttachIndex,sisterAttachIndex}; this.completeIndex = checkModel.getIndex(Parser.COMPLETE); }
attachNode = cfn; if (etype == ParserEventTypeEnum.ATTACH) { parseEvents.add(new Event(attachType, attachContextGenerator.getContext(currentChunks, ci, currentRightFrontier, attachNodeIndex))); if (etype == ParserEventTypeEnum.ATTACH) { parseEvents.add(new Event(Parser.ATTACH_SISTER, attachContextGenerator.getContext(currentChunks, ci, currentRightFrontier, cfi))); if (etype == ParserEventTypeEnum.ATTACH) { parseEvents.add(new Event(Parser.NON_ATTACH, attachContextGenerator.getContext(currentChunks, ci, currentRightFrontier, cfi)));
private Parser(MaxentModel buildModel, MaxentModel attachModel, MaxentModel checkModel, POSTagger tagger, Chunker chunker, HeadRules headRules, int beamSize, double advancePercentage) { super(tagger,chunker,headRules,beamSize,advancePercentage); this.buildModel = buildModel; this.attachModel = attachModel; this.checkModel = checkModel; this.buildContextGenerator = new BuildContextGenerator(); this.attachContextGenerator = new AttachContextGenerator(punctSet); this.checkContextGenerator = new CheckContextGenerator(punctSet); this.bprobs = new double[buildModel.getNumOutcomes()]; this.aprobs = new double[attachModel.getNumOutcomes()]; this.cprobs = new double[checkModel.getNumOutcomes()]; this.doneIndex = buildModel.getIndex(DONE); this.sisterAttachIndex = attachModel.getIndex(ATTACH_SISTER); this.daughterAttachIndex = attachModel.getIndex(ATTACH_DAUGHTER); this.nonAttachIndex = attachModel.getIndex(NON_ATTACH); attachments = new int[] {daughterAttachIndex,sisterAttachIndex}; this.completeIndex = checkModel.getIndex(Parser.COMPLETE); }
attachNode = cfn; if (etype == ParserEventTypeEnum.ATTACH) { parseEvents.add(new Event(attachType, attachContextGenerator.getContext(currentChunks, ci, currentRightFrontier, attachNodeIndex))); if (etype == ParserEventTypeEnum.ATTACH) { parseEvents.add(new Event(Parser.ATTACH_SISTER, attachContextGenerator.getContext(currentChunks, ci, currentRightFrontier, cfi))); if (etype == ParserEventTypeEnum.ATTACH) { parseEvents.add(new Event(Parser.NON_ATTACH, attachContextGenerator.getContext(currentChunks, ci, currentRightFrontier, cfi)));
for (int fi = 0,fs = rf.size(); fi < fs; fi++) { Parse fn = rf.get(fi); attachModel.eval(attachContextGenerator.getContext(children, advanceNodeIndex, rf, fi), aprobs); if (debugOn) {
for (int fi = 0,fs = rf.size(); fi < fs; fi++) { Parse fn = rf.get(fi); attachModel.eval(attachContextGenerator.getContext(children, advanceNodeIndex, rf, fi), aprobs); if (debugOn) {