Tabnine Logo
BaleenAnnotator
Code IndexAdd Tabnine to your IDE (free)

How to use
BaleenAnnotator
in
uk.gov.dstl.baleen.uima

Best Java code snippets using uk.gov.dstl.baleen.uima.BaleenAnnotator (Showing top 20 results out of 315)

origin: uk.gov.dstl.baleen/baleen-uima

@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
 // This will do initialization of resources,
 // but won't be included in the metrics
 super.initialize(context);
 String pipelineName = UimaUtils.getPipelineName(context);
 monitor = createMonitor(pipelineName);
 support = createSupport(pipelineName, context);
 monitor.startFunction("initialize");
 doInitialize(context);
 monitor.finishFunction("initialize");
 String uuid = (String) getContext().getConfigParameterValue(PipelineBuilder.ANNOTATOR_UUID);
 AnalysisEngineActionStore.getInstance().add(uuid, getAction());
}
origin: uk.gov.dstl.baleen/baleen-uima

/**
 * Add a new annotation, which is merged from the old annotations, removing the old annotations.
 *
 * @param newAnnotation The annotation which is to be added to the document as the merged result
 *     of the old annotations
 * @param annotations Annotation(s) which have been merged and should be removed
 */
protected void mergeWithNew(Annotation newAnnotation, Annotation... annotations) {
 getSupport().mergeWithNew(newAnnotation, annotations);
}
origin: uk.gov.dstl.baleen/baleen-odin

@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
 super.initialize(context);
 processor = new CluProcessor(ConfigFactory.load("cluprocessoropen"));
}
origin: dstl/baleen

@Override
public void doInitialize(final UimaContext aContext) throws ResourceInitializationException {
 super.doInitialize(aContext);
 if (typeNames == null || typeNames.length == 0) {
  structuralClasses = Sets.newHashSet(DEFAULT_STRUCTURAL_CLASSES);
 } else {
  structuralClasses = StructureUtil.getStructureClasses(typeNames);
 }
}
origin: dstl/baleen

@Override
public void destroy() {
 monitor.startFunction("destroy");
 doDestroy();
 monitor.finishFunction("destroy");
}
origin: dstl/baleen

@Override
public void process(JCas aJCas) throws AnalysisEngineProcessException {
 monitor.trace("Starting: " + getClass().getSimpleName());
 monitor.startFunction("process");
 doProcess(aJCas);
 monitor.finishFunction("process");
 monitor.persistCounts();
 monitor.trace("Finished: " + getClass().getSimpleName());
}
origin: uk.gov.dstl.baleen/baleen-uima

@Override
public void doInitialize(final UimaContext aContext) throws ResourceInitializationException {
 super.doInitialize(aContext);
 if (typeNames == null || typeNames.length == 0) {
  structuralClasses = Sets.newHashSet(DEFAULT_STRUCTURAL_CLASSES);
 } else {
  structuralClasses = StructureUtil.getStructureClasses(typeNames);
 }
}
origin: uk.gov.dstl.baleen/baleen-uima

@Override
public void destroy() {
 monitor.startFunction("destroy");
 doDestroy();
 monitor.finishFunction("destroy");
}
origin: uk.gov.dstl.baleen/baleen-uima

@Override
public void process(JCas aJCas) throws AnalysisEngineProcessException {
 monitor.trace("Starting: " + getClass().getSimpleName());
 monitor.startFunction("process");
 doProcess(aJCas);
 monitor.finishFunction("process");
 monitor.persistCounts();
 monitor.trace("Finished: " + getClass().getSimpleName());
}
origin: dstl/baleen

@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
 // This will do initialization of resources,
 // but won't be included in the metrics
 super.initialize(context);
 String pipelineName = UimaUtils.getPipelineName(context);
 monitor = createMonitor(pipelineName);
 support = createSupport(pipelineName, context);
 monitor.startFunction("initialize");
 doInitialize(context);
 monitor.finishFunction("initialize");
 String uuid = (String) getContext().getConfigParameterValue(PipelineBuilder.ANNOTATOR_UUID);
 AnalysisEngineActionStore.getInstance().add(uuid, getAction());
}
origin: dstl/baleen

@Override
public void doInitialize(UimaContext aContext) throws ResourceInitializationException {
 super.doInitialize(aContext);
 try {
  classifierModel = new FileObject<cc.mallet.classify.Classifier>(modelPath).object();
 } catch (Exception e) {
  throw new ResourceInitializationException();
 }
}
origin: uk.gov.dstl.baleen/baleen-uima

/**
 * Merge an existing annotation with old annotations, removing the old annotations.
 *
 * @param existingAnnotation The annotation which exists and is to be left in the document
 *     (merged)
 * @param annotations Annotation(s) which have been merged wiht existingAnnotation and then
 *     removed
 */
protected void mergeWithExisting(Annotation existingAnnotation, Annotation... annotations) {
 getSupport().mergeWithExisting(existingAnnotation, annotations);
}
origin: dstl/baleen

 @Override
 protected void doDestroy() {
  try {
   candidateSupplier.close();
  } catch (Exception e) {
   getMonitor().warn("Error closing resources", e);
  }
  super.doDestroy();
 }
}
origin: dstl/baleen

@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
 super.initialize(context);
 processor = new CluProcessor(ConfigFactory.load("cluprocessoropen"));
}
origin: uk.gov.dstl.baleen/baleen-mallet

@Override
public void doInitialize(UimaContext aContext) throws ResourceInitializationException {
 super.doInitialize(aContext);
 try {
  classifierModel = new FileObject<cc.mallet.classify.Classifier>(modelPath).object();
 } catch (Exception e) {
  throw new ResourceInitializationException();
 }
}
origin: dstl/baleen

/**
 * Add an annotation to the JCas index, notifying UimaMonitor of the fact we have done so
 *
 * @param annot Annotation(s) to add
 */
protected void addToJCasIndex(Collection<? extends Annotation> annotations) {
 getSupport().add(annotations);
}
origin: uk.gov.dstl.baleen/baleen-entity-linking

 @Override
 protected void doDestroy() {
  try {
   candidateSupplier.close();
  } catch (Exception e) {
   getMonitor().warn("Error closing resources", e);
  }
  super.doDestroy();
 }
}
origin: dstl/baleen

@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
 super.initialize(context);
 String rules;
 try {
  rules = readFile();
  TaxonomyFactory taxonomyFactory = new TaxonomyFactory(includedTypeNames);
  OdinConfigurationProcessor ruleProcessor =
    new OdinConfigurationProcessor(taxonomyFactory.create(), rules);
  ee = ExtractorEngine.fromRules(ruleProcessor.process());
 } catch (UIMAException | IOException e) {
  throw new ResourceInitializationException(e);
 }
}
origin: uk.gov.dstl.baleen/baleen-mallet

@Override
public void doInitialize(UimaContext aContext) throws ResourceInitializationException {
 super.doInitialize(aContext);
 try {
  model = ParallelTopicModel.read(new File(modelPath));
  pipe = new TopicModelPipe(stopwordResource.getStopwords(stoplist), model.getAlphabet());
  topicWords = new TopicWords(model);
 } catch (Exception e) {
  throw new ResourceInitializationException();
 }
}
origin: uk.gov.dstl.baleen/baleen-uima

/**
 * Add an annotation to the JCas index, notifying UimaMonitor of the fact we have done so
 *
 * @param annot Annotation(s) to add
 */
protected void addToJCasIndex(Annotation... annotations) {
 getSupport().add(annotations);
}
uk.gov.dstl.baleen.uimaBaleenAnnotator

Javadoc

This class provides basic functionality for an annotator, such as metrics and logging, so that we don't need to put it into every annotator manually. All annotators in Baleen should inherit from this class and use any utility methods it provides as required to ensure we standardise logging and metrics as much as possible.

Most used methods

  • doInitialize
    Called when the analysis engine is being initialized. Any required resources, for example, should be
  • doDestroy
    Called when the analysis engine has finished and is closing down. Any open resources, for example, s
  • createMonitor
  • createSupport
  • doProcess
    Called when UIMA wants the annotator to process a document. The passed JCas object contains informat
  • getAction
    Return an AnalysisEngineAction that programmatically describes what the analysis engine is doing, su
  • getContext
  • getSupport
    Get the UIMA support for this annotator.
  • initialize

Popular in Java

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSystemService (Context)
  • Menu (java.awt)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • JPanel (javax.swing)
  • 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