Package org.icij.datashare.text.nlp
Class AbstractPipeline
- java.lang.Object
-
- org.icij.datashare.text.nlp.AbstractPipeline
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.icij.datashare.text.nlp.Pipeline
Pipeline.Property, Pipeline.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected booleancachingprotected Charsetencodingprotected org.slf4j.LoggerLOGGERstatic StringNLP_STAGES_PROPprotected Map<NlpStage,List<NlpStage>>stageDependenciesprotected List<NlpStage>stagesprotected List<NamedEntity.Category>targetEntitiesprotected List<NlpStage>targetStages-
Fields inherited from interface org.icij.datashare.text.nlp.Pipeline
DEFAULT_CACHING, DEFAULT_ENCODING, DEFAULT_ENTITIES, DEFAULT_TARGET_STAGES
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPipeline(Properties properties)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static AbstractPipelinecreate(String pipelineName, PropertiesProvider propertiesProvider)CharsetgetEncoding()List<NlpStage>getStages()List<NamedEntity.Category>getTargetEntities()Pipeline.TypegetType()booleaninitialize(Language language)Prepare pipeline run Check language support for implied stages.booleanisCaching()abstract List<NamedEntity>process(Document doc)Apply all specified stages/annotators on inputabstract Map<Language,Set<NlpStage>>supportedStages()booleansupports(NlpStage stage, Language language)Is stage supported for language?voidterminate(Language language)Post-processing operations-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.icij.datashare.text.nlp.Pipeline
getPosTagSet, process
-
-
-
-
Field Detail
-
NLP_STAGES_PROP
public static final String NLP_STAGES_PROP
- See Also:
- Constant Field Values
-
LOGGER
protected final org.slf4j.Logger LOGGER
-
encoding
protected final Charset encoding
-
targetEntities
protected final List<NamedEntity.Category> targetEntities
-
caching
protected final boolean caching
-
-
Constructor Detail
-
AbstractPipeline
protected AbstractPipeline(Properties properties)
-
-
Method Detail
-
getType
public Pipeline.Type getType()
-
getTargetEntities
public List<NamedEntity.Category> getTargetEntities()
- Specified by:
getTargetEntitiesin interfacePipeline- Returns:
- the list of all targeted named entity categories
-
isCaching
public boolean isCaching()
-
getEncoding
public Charset getEncoding()
- Specified by:
getEncodingin interfacePipeline- Returns:
- the list of all involved stages
-
create
public static AbstractPipeline create(String pipelineName, PropertiesProvider propertiesProvider) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException
-
initialize
public boolean initialize(Language language) throws InterruptedException
Prepare pipeline run Check language support for implied stages.- Specified by:
initializein interfacePipeline- Returns:
- false if any stage is not supported in language; true otherwise
- Throws:
InterruptedException
-
process
public abstract List<NamedEntity> process(Document doc) throws InterruptedException
Apply all specified stages/annotators on input- Specified by:
processin interfacePipeline- Parameters:
doc- is the document source to process- Throws:
InterruptedException
-
terminate
public void terminate(Language language) throws InterruptedException
Post-processing operations- Specified by:
terminatein interfacePipeline- Throws:
InterruptedException
-
supportedStages
public abstract Map<Language,Set<NlpStage>> supportedStages()
- Returns:
- Language . NlpStage support matrix
-
-