case class ExternalResource(path: String, readAs: Format, options: Map[String, String]) extends WritableAnnotatorComponent with Product with Serializable
This represents an external source which contains information into how an external resource shall be read by Spark-NLP's Resource Helper.
ReadAs.TEXT
will configure the file to be read locally as textReadAs.BINARY
will configure the file to be read locally as binaryReadAs.SPARK
will configure the file to be read by Spark."format"
will need to be defined inoptions
.
Example
ExternalResource( "src/test/resources/regex-matcher/rules.txt", ReadAs.TEXT, Map("delimiter" -> ",") ) ExternalResource( "src/test/resources/regex-matcher/rules.txt", ReadAs.SPARK, Map("format" -> "text", "delimiter" -> ",") )
- path
Path to the resource
- readAs
How to interpret the resource. Possible values are
ReadAs.SPARK, ReadAs.TEXT, ReadAs.BINARY
- options
Options for Spark. Option
format
needs to be set ifreadAs
is set toReadAs.SPARK
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- ExternalResource
- Product
- Equals
- WritableAnnotatorComponent
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Instance Constructors
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val options: Map[String, String]
- val path: String
- val readAs: Format
-
def
serialize: SerializedExternalResource
- Definition Classes
- ExternalResource → WritableAnnotatorComponent
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()