Packages

c

com.johnsnowlabs.nlp

FeaturesFallbackReader

class FeaturesFallbackReader[T <: HasFeatures] extends MLReader[T]

MLReader that loads a model with params and features, and has a fallback mechanism.

The fallback load will be called in case there is an exception during Spark loading (i.e. missing parameters or features).

Usually, you might want to call loadSavedModel in the fallbackLoad method to load a model with default params.

T

The type of the model that extends HasFeatures

Linear Supertypes
MLReader[T], BaseReadWrite, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FeaturesFallbackReader
  2. MLReader
  3. BaseReadWrite
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FeaturesFallbackReader(baseReader: MLReader[T], onRead: (T, String, SparkSession) ⇒ Unit, fallbackLoad: (String, SparkSession) ⇒ T = null)

    baseReader

    The default spark reader

    onRead

    A function that will be called after the model is loaded, allowing to set a model

    fallbackLoad

    A fallback function that will be called in case the main reader fails to load

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. def load(path: String): T
    Definition Classes
    FeaturesFallbackReader → MLReader
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def sc: SparkContext
    Attributes
    protected
    Definition Classes
    BaseReadWrite
  17. def session(sparkSession: SparkSession): FeaturesFallbackReader.this.type
    Definition Classes
    MLReader → BaseReadWrite
  18. final def sparkSession: SparkSession
    Attributes
    protected
    Definition Classes
    BaseReadWrite
  19. final def sqlContext: SQLContext
    Attributes
    protected
    Definition Classes
    BaseReadWrite
  20. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from MLReader[T]

Inherited from BaseReadWrite

Inherited from AnyRef

Inherited from Any

Ungrouped