Class NCBasicModelFactory

  • All Implemented Interfaces:
    NCModelFactory

    public class NCBasicModelFactory
    extends Object
    implements NCModelFactory
    Default implementation of NCModelFactory interface.

    This factory doesn't have any configuration properties and uses Constructor.newInstance(Object...) to construct NCModels.

    Basic factory have to be specified in probe configuration. Here's a probe.conf from Names example using Spring-based factory:
     nlpcraft {
         probe {
             id = "names"
             token = "3141592653589793"
             upLink = "localhost:8201"   # Server to probe data pipe.
             downLink = "localhost:8202" # Probe to server data pipe.
             jarsFolder = null
             models = [
                 "org.apache.nlpcraft.examples.names.NamesModel"
             ]
             modelFactory = {
                 type = "org.apache.nlpcraft.model.factories.spring.NCSpringModelFactory"
                 properties = {
                     javaConfig = "org.apache.nlpcraft.examples.names.NamesConfig"
                 }
             }
             lifecycle = [
             ]
             resultMaxSizeBytes = 1048576
         }
         nlpEngine = "opennlp"
     }
     

    Lines 10-15 specify data model factory and its configuration properties.

    • Constructor Detail

      • NCBasicModelFactory

        public NCBasicModelFactory()
    • Method Detail

      • initialize

        public void initialize​(Map<String,​String> props)
        Description copied from interface: NCModelFactory
        Initializes this factory with properties specified in probe configuration.
        Specified by:
        initialize in interface NCModelFactory
        Parameters:
        props - Configuration properties.