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 fileSystemFromPath(path: String): FileSystem

    Get the Hadoop FileSystem from a given path

    Get the Hadoop FileSystem from a given path

    path

    Path to the resource

    returns

    Hadoop FileSystem

  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def flattenRevertValuesAsKeys(er: ExternalResource): Map[String, String]

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

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

    NOT thread safe.

    NOT thread safe. Do not call from executors.

  18. 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
  19. def getWordCount(externalResource: ExternalResource, wordCount: Map[String, Long] = ..., pipeline: Option[PipelineModel] = None): Map[String, Long]
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def isHTTPProtocol(urlStr: String): Boolean
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def isValidURL(url: String): Boolean
  24. def listLocalFiles(path: String): List[File]
  25. def listResourceDirectory(path: String): Seq[String]
  26. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. def parseKeyArrayValues(externalResource: ExternalResource): Map[String, Array[Float]]
  30. def parseKeyListValues(externalResource: ExternalResource): Map[String, List[String]]
  31. def parseKeyValueText(er: ExternalResource): Map[String, String]

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

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

    General purpose line parser from source Currently read only text files

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

    General purpose line parser from source Currently read only text files

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

    General purpose tuple parser from source Currently read only text files

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

    General purpose tuple parser from source Currently read only text files

  37. def readSparkDataFrame(er: ExternalResource): DataFrame

    General purpose read saved Parquet Currently read only Parquet format

  38. def resolvePath(folder: String): String

    Resolves the given path to its absolute form, handling different file systems.

    Resolves the given path to its absolute form, handling different file systems.

    folder

    The input path to resolve.

    returns

    The resolved absolute path as a string.

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

Inherited from AnyRef

Inherited from Any

Ungrouped