congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
BioChunking
Code IndexAdd Tabnine to your IDE (free)

How to use
BioChunking
in
org.cleartk.ml.chunking

Best Java code snippets using org.cleartk.ml.chunking.BioChunking (Showing top 7 results out of 315)

origin: org.apache.ctakes/ctakes-relation-extractor

@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
 RelationExtractorAnnotator.allowClassifierModelOnClasspath(context);
 super.initialize(context);
 this.chunking = new BioChunking<BaseToken, Modifier>(BaseToken.class, Modifier.class, "typeID");
}
origin: ClearTK/cleartk

@Override
protected Map<SUB_CHUNK_TYPE, String> getSubChunkToOutcomeMap(
  JCas jCas,
  List<SUB_CHUNK_TYPE> chunkComponents,
  List<CHUNK_TYPE> chunks) {
 Feature feature = this.getFeature(jCas);
 Map<SUB_CHUNK_TYPE, String> subChunkToOutcome = new HashMap<SUB_CHUNK_TYPE, String>();
 for (CHUNK_TYPE chunk : chunks) {
  String suffix = this.getOutcomeSuffix(chunk, feature);
  boolean isBegin = true;
  for (SUB_CHUNK_TYPE chunkComponent : JCasUtil.selectCovered(this.subChunkClass, chunk)) {
   if (isBegin) {
    subChunkToOutcome.put(chunkComponent, "B" + suffix);
    isBegin = false;
   } else {
    subChunkToOutcome.put(chunkComponent, "I" + suffix);
   }
  }
 }
 return subChunkToOutcome;
}
origin: ClearTK/cleartk

List<String> outcomes = this.chunking.createOutcomes(jCas, tokens, namedEntityMentions);
this.chunking.createChunks(jCas, tokens, outcomes);
origin: ClearTK/cleartk

List<String> outcomes = this.chunking.createOutcomes(jCas, tokens, times);
this.dataWriter.write(Instances.toInstances(outcomes, featureLists));
this.chunking.createChunks(jCas, tokens, outcomes);
origin: apache/ctakes

@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
 RelationExtractorAnnotator.allowClassifierModelOnClasspath(context);
 super.initialize(context);
 this.chunking = new BioChunking<BaseToken, Modifier>(BaseToken.class, Modifier.class, "typeID");
}
origin: ClearTK/cleartk

@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
 super.initialize(context);
 // define chunking type
 this.chunking = new BioChunking<Token, Time>(Token.class, Time.class);
 // add features: word, character pattern, stem, pos
 this.tokenFeatureExtractors = Lists.newArrayList();
 this.tokenFeatureExtractors.add(new CoveredTextExtractor<Token>());
 NamedFeatureExtractor1<Token> ex = CharacterCategoryPatternFunction.createExtractor();
 this.tokenFeatureExtractors.add(ex);
 this.tokenFeatureExtractors.add(new TimeWordsExtractor<Token>());
 this.tokenFeatureExtractors.add(new TypePathExtractor<Token>(Token.class, "stem"));
 this.tokenFeatureExtractors.add(new TypePathExtractor<Token>(Token.class, "pos"));
   
 // add window of features before and after
 this.contextFeatureExtractors = Lists.newArrayList();
 for (FeatureExtractor1<Token> extractor : this.tokenFeatureExtractors) {
  this.contextFeatureExtractors.add(new CleartkExtractor<Token, Token>(Token.class, extractor, new Preceding(
    3), new Following(3)));
 }
}
origin: ClearTK/cleartk

@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");
}
org.cleartk.ml.chunkingBioChunking

Javadoc

Chunking with Begin-Inside-Outside labels
Copyright (c) 2012, Regents of the University of Colorado
All rights reserved.

Most used methods

  • <init>
  • createChunks
  • createOutcomes
  • getFeature
  • getOutcomeSuffix

Popular in Java

  • Finding current android device location
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now