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 in aCasses in training and test sets by using aDataSplitter, 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 in aCas, predict target annotations.
      void train​(RecommenderContext aContext, java.util.List<org.apache.uima.cas.CAS> aCasses)
      Given training data in aCasses, train a model.
    • Method Detail

      • train

        void train​(RecommenderContext aContext,
                   java.util.List<org.apache.uima.cas.CAS> aCasses)
            throws RecommendationException
        Given training data in aCasses, train a model. In order to save data between runs, the aContext can be used. This method must not mutate aCasses in any way.
        Parameters:
        aContext - The context of the recommender
        aCasses - The training data
        Throws:
        RecommendationException
      • predict

        void predict​(RecommenderContext aContext,
                     org.apache.uima.cas.CAS aCas)
              throws RecommendationException
        Given text in aCas, predict target annotations. These should be written into aCas. In order to restore data from e.g. previous training, the aContext can be used.
        Parameters:
        aContext - The context of the recommender
        aCas - 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 in aCasses in training and test sets by using aDataSplitter, training on the training śet and measuring performance on unseen data on the training set. This method must not mutate aCasses in any way.
        Parameters:
        aCasses - The CASses containing target annotations
        aDataSplitter - 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 by getPredictedType().
        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 by getPredictedType().
        Returns:
        The name of the feature that contains the score.