Class ConvertedModel


  • public class ConvertedModel
    extends Object
    A machine learned model imported from the models/ directory in the application package, for a single rank profile. This encapsulates the difference between reading a model - from a file application package, where it is represented by an ImportedModel, and - from a ZK application package, where the models/ directory is unavailable and models are read from generated files stored in file distribution or ZooKeeper.
    Author:
    bratseth
    • Method Detail

      • fromSourceOrStore

        public static ConvertedModel fromSourceOrStore​(com.yahoo.path.Path modelPath,
                                                       boolean pathIsFile,
                                                       RankProfileTransformContext context)
        Create and store a converted model for a rank profile given from either an imported model, or (if unavailable) from stored application package data.
        Parameters:
        modelPath - the path to the model
        pathIsFile - true if that path (this kind of model) is stored in a file, false if it is in a directory
        context - the transform context
      • fromSource

        public static ConvertedModel fromSource​(com.yahoo.config.application.api.ApplicationPackage applicationPackage,
                                                ModelName modelName,
                                                String modelDescription,
                                                RankProfile rankProfile,
                                                com.yahoo.search.query.profile.QueryProfileRegistry queryProfileRegistry,
                                                ai.vespa.rankingexpression.importer.configmodelview.ImportedMlModel importedModel)
      • fromStore

        public static ConvertedModel fromStore​(com.yahoo.config.application.api.ApplicationPackage applicationPackage,
                                               ModelName modelName,
                                               String modelDescription,
                                               RankProfile rankProfile)
      • expressions

        public Map<String,​com.yahoo.searchlib.rankingexpression.ExpressionFunction> expressions()
        Returns all the output expressions of this indexed by name. The names consist of one or two parts separated by dot, where the first part is the signature name if signatures are used, or the expression name if signatures are not used and there are multiple expressions, and the second is the output name if signature names are used.
      • sourceModelFile

        public static File sourceModelFile​(com.yahoo.config.application.api.ApplicationPackage application,
                                           com.yahoo.path.Path sourceModelPath)
        Returns the directory which contains the source model to use for these arguments