Interface RecommendationEngine
-
public interface RecommendationEngine
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description double
evaluate(java.util.List<org.apache.uima.cas.CAS> aCasses, DataSplitter aDataSplitter)
Evaluates the performance of a recommender by splitting the data given inaCasses
in training and test sets by usingaDataSplitter
, training on the training śet and measuring performance on unseen data on the training set.default java.lang.String
getPredictedFeature()
Returns the name of the feature that is predicted.default java.lang.String
getPredictedType()
Returns the long name of the type this recommender predict, e.g.default java.util.Optional<java.lang.String>
getScoreFeature()
Returns the name of the feature that contains the score.void
predict(RecommenderContext aContext, org.apache.uima.cas.CAS aCas)
Given text inaCas
, predict target annotations.void
train(RecommenderContext aContext, java.util.List<org.apache.uima.cas.CAS> aCasses)
Given training data inaCasses
, train a model.
-
-
-
Method Detail
-
train
void train(RecommenderContext aContext, java.util.List<org.apache.uima.cas.CAS> aCasses) throws RecommendationException
Given training data inaCasses
, train a model. In order to save data between runs, theaContext
can be used. This method must not mutateaCasses
in any way.- Parameters:
aContext
- The context of the recommenderaCasses
- The training data- Throws:
RecommendationException
-
predict
void predict(RecommenderContext aContext, org.apache.uima.cas.CAS aCas) throws RecommendationException
Given text inaCas
, predict target annotations. These should be written intoaCas
. In order to restore data from e.g. previous training, theaContext
can be used.- Parameters:
aContext
- The context of the recommenderaCas
- The training data- Throws:
RecommendationException
-
evaluate
double evaluate(java.util.List<org.apache.uima.cas.CAS> aCasses, DataSplitter aDataSplitter) throws RecommendationException
Evaluates the performance of a recommender by splitting the data given inaCasses
in training and test sets by usingaDataSplitter
, training on the training śet and measuring performance on unseen data on the training set. This method must not mutateaCasses
in any way.- Parameters:
aCasses
- The CASses containing target annotationsaDataSplitter
- The splitter which determines which annotations belong to which set- Returns:
- Score measuring the performance of predicting on the test set
- Throws:
RecommendationException
-
getPredictedType
default java.lang.String getPredictedType()
Returns the long name of the type this recommender predict, e.g."de.tudarmstadt.ukp.dkpro.core.api.ner.type.NamedEntity"
- Returns:
- The long name of the feature that is predicted
-
getPredictedFeature
default java.lang.String getPredictedFeature()
Returns the name of the feature that is predicted. This has to be a feature of the type whose name is returned bygetPredictedType()
.- Returns:
- The name of the feature that is predicted.
-
getScoreFeature
default java.util.Optional<java.lang.String> getScoreFeature()
Returns the name of the feature that contains the score. This has to be a feature of the type whose name is returned bygetPredictedType()
.- Returns:
- The name of the feature that contains the score.
-
-