• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java CombinedExtractor1类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.cleartk.ml.feature.extractor.CombinedExtractor1的典型用法代码示例。如果您正苦于以下问题:Java CombinedExtractor1类的具体用法?Java CombinedExtractor1怎么用?Java CombinedExtractor1使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

CombinedExtractor1类属于org.cleartk.ml.feature.extractor包,在下文中一共展示了CombinedExtractor1类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initialize

点赞 3

import org.cleartk.ml.feature.extractor.CombinedExtractor1; //导入依赖的package包/类
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
	super.initialize(context);

	// the token feature extractor: text, char pattern (uppercase, digits,
	// etc.), and part-of-speech
	this.extractor = new CombinedExtractor1<Token>(new CoveredTextExtractor<Token>(),
			new FeatureFunctionExtractor<Token>(new CoveredTextExtractor<Token>(),
					new CharacterCategoryPatternFunction<Token>(
							CharacterCategoryPatternFunction.PatternType.REPEATS_MERGED))
	/* , new TypePathExtractor(Token.class, "pos") */);

	// the context feature extractor: the features above for the 3 preceding
	// and 3 following tokens
	this.contextExtractor = new CleartkExtractor<Token, Token>(Token.class, this.extractor, new Preceding(3),
			new Following(3));

	// the chunking definition: Tokens will be combined to form Reason annotation
	this.chunking = new BioChunking<Token, Reason>(Token.class, Reason.class, null);
}
 

开发者ID:IE4OpenData,
项目名称:Octroy,
代码行数:21,
代码来源:ReasonAnnotator.java

示例2: initialize

点赞 3

import org.cleartk.ml.feature.extractor.CombinedExtractor1; //导入依赖的package包/类
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
	super.initialize(context);

	// the token feature extractor: text, char pattern (uppercase, digits,
	// etc.), and part-of-speech
	this.extractor = new CombinedExtractor1<Token>(

			new FeatureFunctionExtractor<Token>(new CoveredTextExtractor<Token>(),
					new CharacterCategoryPatternFunction<Token>(PatternType.REPEATS_MERGED)),
			new TypePathExtractor<Token>(Token.class, "pos/PosValue"));

	// the context feature extractor: the features above for the 3 preceding
	// and 3 following tokens
	this.contextExtractor = new CleartkExtractor<Token, Token>(Token.class, this.extractor, new Preceding(2),
			new Following(1));

	// the chunking definition: Tokens will be combined to form
	// NamedEntityMentions, with labels
	// from the "mentionType" attribute so that we get B-location, I-person,
	// etc.
	this.chunking = new BioChunking<Token, FigureMention>(Token.class, FigureMention.class);
}
 

开发者ID:quadrama,
项目名称:DramaNLP,
代码行数:24,
代码来源:ClearTkMentionAnnotator.java

示例3: defaultExtractors

点赞 3

import org.cleartk.ml.feature.extractor.CombinedExtractor1; //导入依赖的package包/类
public static List<FeatureExtractor1> defaultExtractors(int leftContextSize,
                                                        int rightContextSize) {
    List<FeatureExtractor1> feList = Lists.newLinkedList();
    feList.addAll(com.textocat.textokit.ml.DefaultFeatureExtractors.currentTokenExtractors());

    List<FeatureExtractor1> ctxTokenFeatureExtractors = com.textocat.textokit.ml.DefaultFeatureExtractors.contextTokenExtractors();

    if (leftContextSize < 0 || rightContextSize < 0) {
        throw new IllegalStateException("context size < 0");
    }
    if (leftContextSize == 0 && rightContextSize == 0) {
        throw new IllegalStateException("left & right context sizes == 0");
    }
    List<Context> contexts = Lists.newArrayList();
    if (leftContextSize > 0) {
        contexts.add(new CleartkExtractor.Preceding(leftContextSize));
    }
    if (rightContextSize > 0) {
        contexts.add(new CleartkExtractor.Following(rightContextSize));
    }
    feList.add(new CleartkExtractor(Token.class,
            new CombinedExtractor1(ctxTokenFeatureExtractors),
            contexts.toArray(new Context[contexts.size()])));
    return feList;
}
 

开发者ID:textocat,
项目名称:textokit-core,
代码行数:26,
代码来源:DefaultFeatureExtractors.java

示例4: initialize

点赞 3

import org.cleartk.ml.feature.extractor.CombinedExtractor1; //导入依赖的package包/类
public void initialize(UimaContext context) throws ResourceInitializationException {
  super.initialize(context);

  try {
    TfidfExtractor<String, DocumentAnnotation> tfIdfExtractor = initTfIdfExtractor();
    CentroidTfidfSimilarityExtractor<String, DocumentAnnotation> simExtractor = initCentroidTfIdfSimilarityExtractor();
    ZeroMeanUnitStddevExtractor<String, DocumentAnnotation> zmusExtractor = initZmusExtractor();
    MinMaxNormalizationExtractor<String, DocumentAnnotation> minmaxExtractor = initMinMaxExtractor();
    this.extractor = new CombinedExtractor1<DocumentAnnotation>(
        tfIdfExtractor,
        simExtractor,
        zmusExtractor,
        minmaxExtractor);
  } catch (IOException e) {
    throw new ResourceInitializationException(e);
  }
}
 

开发者ID:ClearTK,
项目名称:cleartk,
代码行数:18,
代码来源:DocumentClassificationAnnotator.java

示例5: initZmusExtractor

点赞 3

import org.cleartk.ml.feature.extractor.CombinedExtractor1; //导入依赖的package包/类
private ZeroMeanUnitStddevExtractor<String, DocumentAnnotation> initZmusExtractor()
    throws IOException {
  CombinedExtractor1<DocumentAnnotation> featuresToNormalizeExtractor = new CombinedExtractor1<DocumentAnnotation>(
      new CountAnnotationExtractor<DocumentAnnotation>(Sentence.class),
      new CountAnnotationExtractor<DocumentAnnotation>(Token.class));

  ZeroMeanUnitStddevExtractor<String, DocumentAnnotation> zmusExtractor = new ZeroMeanUnitStddevExtractor<String, DocumentAnnotation>(
      ZMUS_EXTRACTOR_KEY,
      featuresToNormalizeExtractor);

  if (this.zmusUri != null) {
    zmusExtractor.load(this.zmusUri);
  }

  return zmusExtractor;
}
 

开发者ID:ClearTK,
项目名称:cleartk,
代码行数:17,
代码来源:DocumentClassificationAnnotator.java

示例6: initMinMaxExtractor

点赞 3

import org.cleartk.ml.feature.extractor.CombinedExtractor1; //导入依赖的package包/类
private MinMaxNormalizationExtractor<String, DocumentAnnotation> initMinMaxExtractor()
    throws IOException {
  CombinedExtractor1<DocumentAnnotation> featuresToNormalizeExtractor = new CombinedExtractor1<DocumentAnnotation>(
      new CountAnnotationExtractor<DocumentAnnotation>(Sentence.class),
      new CountAnnotationExtractor<DocumentAnnotation>(Token.class));

  MinMaxNormalizationExtractor<String, DocumentAnnotation> minmaxExtractor = new MinMaxNormalizationExtractor<String, DocumentAnnotation>(
      MINMAX_EXTRACTOR_KEY,
      featuresToNormalizeExtractor);

  if (this.minmaxUri != null) {
    minmaxExtractor.load(this.minmaxUri);
  }

  return minmaxExtractor;
}
 

开发者ID:ClearTK,
项目名称:cleartk,
代码行数:17,
代码来源:DocumentClassificationAnnotator.java

示例7: initialize

点赞 3

import org.cleartk.ml.feature.extractor.CombinedExtractor1; //导入依赖的package包/类
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
  super.initialize(context);

  // the token feature extractor: text, char pattern (uppercase, digits, etc.), and part-of-speech
  this.extractor = new CombinedExtractor1<Token>(
      new FeatureFunctionExtractor<Token>(
          new CoveredTextExtractor<Token>(),
          new CharacterCategoryPatternFunction<Token>(PatternType.REPEATS_MERGED)),
      new TypePathExtractor<Token>(Token.class, "pos"));

  // the context feature extractor: the features above for the 3 preceding and 3 following tokens
  this.contextExtractor = new CleartkExtractor<Token, Token>(
      Token.class,
      this.extractor,
      new Preceding(3),
      new Following(3));

  // the chunking definition: Tokens will be combined to form NamedEntityMentions, with labels
  // from the "mentionType" attribute so that we get B-location, I-person, etc.
  this.chunking = new BioChunking<Token, NamedEntityMention>(
      Token.class,
      NamedEntityMention.class,
      "mentionType");
}
 

开发者ID:ClearTK,
项目名称:cleartk,
代码行数:26,
代码来源:NamedEntityChunker.java

示例8: createXStream

点赞 2

import org.cleartk.ml.feature.extractor.CombinedExtractor1; //导入依赖的package包/类
public static XStream createXStream() {
	//define alias so the xml file can be read easier
	XStream xstream = new XStream();
	// org.cleartk.classifier.feature.*
	xstream.alias("TypePathExtractor", TypePathExtractor.class);
	xstream.alias("FeatureCollection", FeatureCollection.class);

	// org.cleartk.ml.feature.extractor.*
	xstream.alias("CleartkExtractor", CleartkExtractor.class);
	xstream.alias("CombinedExtractor1", CombinedExtractor1.class);
	xstream.alias("CoveredTextExtractor", CoveredTextExtractor.class);
	xstream.alias("DirectedDistanceExtractor", DirectedDistanceExtractor.class);
       xstream.alias("DistanceExtractor", DistanceExtractor.class);
       xstream.alias("FeatureExtractor1", FeatureExtractor1.class);
       xstream.alias("FeatureExtractor2", FeatureExtractor2.class);
       xstream.alias("NamedFeatureExtractor1", NamedFeatureExtractor1.class);
       xstream.alias("NamingExtractor1", NamingExtractor1.class);
       xstream.alias("RelativePositionExtractor", RelativePositionExtractor.class);
       xstream.alias("WhiteSpaceExtractor", WhiteSpaceExtractor.class);


	// within CleartkExtractor
	xstream.alias("Bag", Bag.class);
	xstream.alias("Preceding", Preceding.class);
	xstream.alias("Following", Following.class);
	xstream.alias("Covered", Covered.class);
	xstream.alias("FirstCovered", FirstCovered.class);
	xstream.alias("LastCovered", LastCovered.class);
	xstream.alias("Ngram", Ngram.class);

	xstream.alias("list", ArrayList.class);
	return xstream;
}
 

开发者ID:floschne,
项目名称:NLP_ProjectNER,
代码行数:34,
代码来源:XStreamFactory.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)