/** * When conll() is true, coref models: * <ul> * <li>Use provided POS, NER, Parsing, etc. (instead of using CoreNLP annotators)</li> * <li>Use provided speaker annotations</li> * <li>Use provided document type and genre information</li> * </ul> */ public static boolean conll(Properties props) { return PropertiesUtils.getBool(props, "coref.conll", false); }
/** * Construct a basic pipeline. The Properties will be used to determine * which annotators to create, and a default AnnotatorPool will be used * to create the annotators. * */ public StanfordCoreNLP(Properties props) { this(props, (props == null || PropertiesUtils.getBool(props, "enforceRequirements", true))); }
public static boolean doScore(Properties props) { return PropertiesUtils.getBool(props, SCORE_PROP, false); } public static boolean checkTime(Properties props) {
public static boolean printMDLog(Properties props) { return PropertiesUtils.getBool(props, PRINT_MDLOG_PROP, false); } public static boolean doPostProcessing(Properties props) {
/** if true, use conll auto files, else use conll gold files */ public static boolean useCoNLLAuto(Properties props) { return PropertiesUtils.getBool(props, CONLL_AUTO_PROP, true); }
public static boolean doAnalysis(Properties props) { return PropertiesUtils.getBool(props, DO_ANALYSIS_PROP, false); } public static String getSkipMentionType(Properties props) {
/** * Load a boolean property. If the key is not present, returns false. */ public static boolean getBool(Properties props, String key) { return getBool(props, key, false); }
public static boolean usePOSFeatures(Properties props, String sievename) { return PropertiesUtils.getBool(props, USE_POS_FEATURES_PROP.replace("SIEVENAME", sievename), true); } public static boolean useLexicalFeatures(Properties props, String sievename) {
public static boolean useMentionDetectionFeatures(Properties props, String sievename) { return PropertiesUtils.getBool(props, USE_MD_FEATURES_PROP.replace("SIEVENAME", sievename), true); } public static boolean useDcorefRules(Properties props, String sievename) {
public void setOptions(String options) { Properties prop = StringUtils.stringToProperties(options); tokenizeNLs = PropertiesUtils.getBool(prop, "tokenizeNLs", tokenizeNLs); } }
public NumberAnnotator(String name, Properties props) { String property = name + '.' + BACKGROUND_SYMBOL_PROPERTY; BACKGROUND_SYMBOL = props.getProperty(property, DEFAULT_BACKGROUND_SYMBOL); boolean useSUTime = PropertiesUtils.getBool(props, NumberSequenceClassifier.USE_SUTIME_PROPERTY, NumberSequenceClassifier.USE_SUTIME_DEFAULT); VERBOSE = false; nsc = new NumberSequenceClassifier(useSUTime); }
@Override public void setOptions(String options) { Properties prop = StringUtils.stringToProperties(options); tokenizeNLs = PropertiesUtils.getBool(prop, "tokenizeNLs", tokenizeNLs); }
public QuantifiableEntityNormalizingAnnotator(String name, Properties props) { String property = name + "." + BACKGROUND_SYMBOL_PROPERTY; String backgroundSymbol = props.getProperty(property, DEFAULT_BACKGROUND_SYMBOL); // this next line is yuck as QuantifiableEntityNormalizer is still static QuantifiableEntityNormalizer.BACKGROUND_SYMBOL = backgroundSymbol; property = name + "." + COLLAPSE_PROPERTY; collapse = PropertiesUtils.getBool(props, property, false); if (this.collapse) { log.info("WARNING: QuantifiableEntityNormalizingAnnotator does not work well with collapse=true"); } VERBOSE = false; }
public WhitespaceTokenizerFactory(LexedTokenFactory<T> factory, String options) { this.factory = factory; Properties prop = StringUtils.stringToProperties(options); this.tokenizeNLs = PropertiesUtils.getBool(prop, "tokenizeNLs", false); }
public ColumnDataClassifierAnnotator(Properties props) { cdcClassifier = new ColumnDataClassifier(props); verbose = PropertiesUtils.getBool(props, "classify.verbose", false); }
public NERClassifierCombiner(Properties props) throws IOException { super(props); applyNumericClassifiers = PropertiesUtils.getBool(props, APPLY_NUMERIC_CLASSIFIERS_PROPERTY, APPLY_NUMERIC_CLASSIFIERS_DEFAULT); nerLanguage = Language.fromString(PropertiesUtils.getString(props, NER_LANGUAGE_PROPERTY, null), NER_LANGUAGE_DEFAULT); useSUTime = PropertiesUtils.getBool(props, NumberSequenceClassifier.USE_SUTIME_PROPERTY, NumberSequenceClassifier.USE_SUTIME_DEFAULT); nsc = new NumberSequenceClassifier(new Properties(), useSUTime, props); }
public Options(Properties properties) { includeText = PropertiesUtils.getBool(properties, "output.includeText", false); encoding = properties.getProperty("encoding", "UTF-8"); pretty = PropertiesUtils.getBool(properties, "output.prettyPrint", true); String constituencyTreeStyle = properties.getProperty("output.constituencyTree", "penn"); constituencyTreePrinter = new TreePrint(constituencyTreeStyle); String dependencyTreeStyle = properties.getProperty("output.dependencyTree", "typedDependenciesCollapsed"); dependencyTreePrinter = new TreePrint(dependencyTreeStyle); coreferenceContextSize = PropertiesUtils.getInt(properties,"output.coreferenceContextSize", 0); printSingletons = PropertiesUtils.getBool(properties, "output.printSingletonEntities", false); relationsBeam = PropertiesUtils.getDouble(properties, "output.relation.beam", 0.0); keysToPrint = getKeysToPrint(properties.getProperty("output.columns", DEFAULT_KEYS)); }
public POSTaggerAnnotator(String annotatorName, Properties props) { String posLoc = props.getProperty(annotatorName + ".model"); if (posLoc == null) { posLoc = DefaultPaths.DEFAULT_POS_MODEL; } boolean verbose = PropertiesUtils.getBool(props, annotatorName + ".verbose", false); this.pos = loadModel(posLoc, verbose); this.maxSentenceLength = PropertiesUtils.getInt(props, annotatorName + ".maxlen", Integer.MAX_VALUE); this.nThreads = PropertiesUtils.getInt(props, annotatorName + ".nthreads", PropertiesUtils.getInt(props, "nthreads", 1)); this.reuseTags = PropertiesUtils.getBool(props, annotatorName + ".reuseTags", false); }
@Override public Tokenizer<T> getTokenizer(Reader r, String extraOptions) { Properties prop = StringUtils.stringToProperties(extraOptions); boolean tokenizeNewlines = PropertiesUtils.getBool(prop, "tokenizeNLs", this.tokenizeNLs); return new WhitespaceTokenizer<>(factory, r, tokenizeNewlines); }
public Tokenizer<HasWord> getTokenizer(Reader r, String extraOptions) { boolean tokenizeNewlines = this.tokenizeNLs; if (extraOptions != null) { Properties prop = StringUtils.stringToProperties(extraOptions); tokenizeNewlines = PropertiesUtils.getBool(prop, "tokenizeNLs", this.tokenizeNLs); } return new WordSegmentingTokenizer(segmenter, WhitespaceTokenizer.newCoreLabelWhitespaceTokenizer(r, tokenizeNewlines)); }