Packages

o

com.johnsnowlabs.nlp.util.io

ResourceHelper

object ResourceHelper

Helper one-place for IO management. Streams, source and external input should be handled from here

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ResourceHelper
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class SourceStream(resource: String) extends Product with Serializable

    Structure for a SourceStream coming from compiled content

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. def copyToLocal(path: String): String

    Copies the remote resource to a local temporary folder and returns its absolute path.

    Copies the remote resource to a local temporary folder and returns its absolute path.

    Currently, file:/, s3:/, hdfs:/ and dbfs:/ are supported.

    If the file is already on the local file system just the absolute path will be returned instead.

    path

    Path to the resource

    returns

    Absolute path to the temporary or local folder of the resource

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def flattenRevertValuesAsKeys(er: ExternalResource): Map[String, String]

    For multiple values per keys, this optimizer flattens all values for keys to have constant access

  11. def getActiveSparkSession: SparkSession
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def getFileFromPath(pathToFile: String): File
  14. def getFilesContentBuffer(externalResource: ExternalResource): Seq[Iterator[String]]
  15. def getResourceFile(path: String): URL
  16. def getResourceStream(path: String): InputStream

    NOT thread safe.

    NOT thread safe. Do not call from executors.

  17. def getSparkSessionWithS3(awsAccessKeyId: String, awsSecretAccessKey: String, hadoopAwsVersion: String = ConfigHelper.hadoopAwsVersion, AwsJavaSdkVersion: String = ConfigHelper.awsJavaSdkVersion, region: String = "us-east-1", s3Impl: String = ..., pathStyleAccess: Boolean = true, credentialsProvider: String = "TemporaryAWSCredentialsProvider", awsSessionToken: Option[String] = None): SparkSession
  18. def getWordCount(externalResource: ExternalResource, wordCount: Map[String, Long] = ..., pipeline: Option[PipelineModel] = None): Map[String, Long]
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def listLocalFiles(path: String): List[File]
  22. def listResourceDirectory(path: String): Seq[String]
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. def parseKeyArrayValues(externalResource: ExternalResource): Map[String, Array[Float]]
  27. def parseKeyListValues(externalResource: ExternalResource): Map[String, List[String]]
  28. def parseKeyValueText(er: ExternalResource): Map[String, String]

    General purpose key value parser from source Currently read only text files

  29. def parseLines(er: ExternalResource): Array[String]

    General purpose line parser from source Currently read only text files

  30. def parseLinesIterator(er: ExternalResource): Seq[Iterator[String]]

    General purpose line parser from source Currently read only text files

  31. def parseTupleSentences(er: ExternalResource): Array[TaggedSentence]

    General purpose tuple parser from source Currently read only text files

  32. def parseTupleSentencesDS(er: ExternalResource): Dataset[TaggedSentence]
  33. def parseTupleText(er: ExternalResource): Array[(String, String)]

    General purpose tuple parser from source Currently read only text files

  34. def readSparkDataFrame(er: ExternalResource): DataFrame

    General purpose read saved Parquet Currently read only Parquet format

  35. lazy val spark: SparkSession
  36. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  37. def toString(): String
    Definition Classes
    AnyRef → Any
  38. def validFile(path: String): Boolean
  39. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped