public MLEDependencyGrammar( TagProjection tagProjection, TreebankLangParserParams tlpParams, boolean directional, boolean useDistance, boolean useCoarseDistance, Options op, Index<String> wordIndex, Index<String> tagIndex) { super( tlpParams.treebankLanguagePack(), tagProjection, directional, useDistance, useCoarseDistance, op, wordIndex, tagIndex); useSmoothTagProjection = op.useSmoothTagProjection; useUnigramWordSmoothing = op.useUnigramWordSmoothing; argCounter = new ClassicCounter<IntDependency>(); stopCounter = new ClassicCounter<IntDependency>(); double[] smoothParams = tlpParams.MLEDependencyGrammarSmoothingParams(); smooth_aT_hTWd = smoothParams[0]; smooth_aTW_hTWd = smoothParams[1]; smooth_stop = smoothParams[2]; interp = smoothParams[3]; // cdm added Jan 2007 to play with dep grammar smoothing. Integrate this better if we keep it! smoothTP = new BasicCategoryTagProjection(tlpParams.treebankLanguagePack()); }
/** * Determines method for print trees on output. * * @param tlpParams The treebank parser params * @return A suitable tree printing object */ public TreePrint treePrint(TreebankLangParserParams tlpParams) { TreebankLanguagePack tlp = tlpParams.treebankLanguagePack(); return new TreePrint( outputFormat, outputFormatOptions, tlp, tlpParams.headFinder(), tlpParams.typedDependencyHeadFinder()); }
public TransformTreeDependency(TreebankLangParserParams tlpParams, boolean forceCNF) { if (!Train.leftToRight) { binarizer = new TreeAnnotatorAndBinarizer(tlpParams, forceCNF, !Train.outsideFactor(), true); } else { binarizer = new TreeAnnotatorAndBinarizer( tlpParams.headFinder(), new LeftHeadFinder(), tlpParams, forceCNF, !Train.outsideFactor(), true); } if (Train.collinsPunc) { collinsPuncTransformer = new CollinsPuncTransformer(tlpParams.treebankLanguagePack()); } }
public MLEDependencyGrammar( TreebankLangParserParams tlpParams, boolean directional, boolean distance, boolean coarseDistance, boolean basicCategoryTagsInDependencyGrammar, Options op, Index<String> wordIndex, Index<String> tagIndex) { this( basicCategoryTagsInDependencyGrammar ? new BasicCategoryTagProjection(tlpParams.treebankLanguagePack()) : new TestTagProjection(), tlpParams, directional, distance, coarseDistance, op, wordIndex, tagIndex); }