Packages

c

com.johnsnowlabs.nlp.annotators.ner

Gliner2SchemaBuilder

class Gliner2SchemaBuilder extends AnyRef

Schema builder for extraction tasks. Formates the schema for inference of the ONNX model.

Provides a fluent API for building extraction schemas that include:

  • Entity extraction configurations
  • Classification tasks
  • Relation extraction
  • Structured data extraction with fields
  • Validation rules

Example:

val schema = new Schema()
  .entities(Map(
    "person" -> "Names of people",
    "company" -> "Organization names"
  ))
  .classification("sentiment", List("positive", "negative", "neutral"))
  .relations(List("works_for", "founded"))
  .structure("product_info")
    .field("name", dtype = "str")
    .field("price", dtype = "str")
    .field("availability", choices = Some(List("in_stock", "out_of_stock")))
  .build()
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Gliner2SchemaBuilder
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Gliner2SchemaBuilder()

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 build(): Gliner2Schema

    Build final schema output.

    Build final schema output.

    returns

    SchemaOutput containing the complete typed schema

  6. def classification(task: String, labels: Seq[String], multiLabel: Boolean = false, clsThreshold: Double = 0.5, extraParams: Map[String, Any] = Map.empty): Gliner2SchemaBuilder

    Add classification task.

    Add classification task.

    task

    Task name

    labels

    Sequence of label names

    multiLabel

    Whether this is a multi-label classification

    clsThreshold

    Confidence threshold

    extraParams

    Additional parameters

    returns

    This schema for chaining

  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  8. def entities(entityType: String, dtype: String, threshold: Option[Double]): Gliner2SchemaBuilder

    Add single entity extraction task with options.

    Add single entity extraction task with options.

    entityType

    Entity name

    dtype

    Data type: "str" or "list"

    threshold

    Optional confidence threshold

    returns

    This schema for chaining

  9. def entities(entityType: String): Gliner2SchemaBuilder

    Add single entity extraction task.

    Add single entity extraction task.

    entityType

    Entity name

    returns

    This schema for chaining

  10. def entities(entityTypes: Seq[String], dtype: String, threshold: Option[Double]): Gliner2SchemaBuilder

    Add entity extraction task (Seq input) with options.

    Add entity extraction task (Seq input) with options.

    entityTypes

    Sequence of entity names

    dtype

    Data type: "str" or "list"

    threshold

    Optional confidence threshold

    returns

    This schema for chaining

  11. def entities(entityTypes: Seq[String]): Gliner2SchemaBuilder

    Add entity extraction task (Seq input).

    Add entity extraction task (Seq input).

    entityTypes

    Sequence of entity names

    returns

    This schema for chaining

  12. def entities(entityTypes: Map[String, String], dtype: String = "list", threshold: Option[Double] = None): Gliner2SchemaBuilder

    Add entity extraction task with descriptions (Map input).

    Add entity extraction task with descriptions (Map input).

    entityTypes

    Map of entity names to descriptions

    dtype

    Data type: "str" or "list"

    threshold

    Optional confidence threshold

    returns

    This schema for chaining

  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. def relations(relationTypes: Map[String, String], threshold: Option[Double]): Gliner2SchemaBuilder

    Add relation extraction task (Map input with descriptions) with threshold.

    Add relation extraction task (Map input with descriptions) with threshold.

    relationTypes

    Map of relation names to descriptions

    threshold

    Optional confidence threshold

    returns

    This schema for chaining

  23. def relations(relationTypes: Map[String, String]): Gliner2SchemaBuilder

    Add relation extraction task (Map input with descriptions).

    Add relation extraction task (Map input with descriptions).

    relationTypes

    Map of relation names to descriptions

    returns

    This schema for chaining

  24. def relations(relationTypes: Seq[String], threshold: Option[Double]): Gliner2SchemaBuilder

    Add relation extraction task (Seq input) with threshold.

    Add relation extraction task (Seq input) with threshold.

    relationTypes

    Sequence of relation names

    threshold

    Optional confidence threshold

    returns

    This schema for chaining

  25. def relations(relationTypes: Seq[String]): Gliner2SchemaBuilder

    Add relation extraction task (Seq input).

    Add relation extraction task (Seq input).

    relationTypes

    Sequence of relation names

    returns

    This schema for chaining

  26. def structure(name: String): StructureBuilder

    Start building a structure schema.

    Start building a structure schema.

    name

    The name of the structure

    returns

    A StructureBuilder for chaining field definitions

  27. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  28. def toString(): String
    Definition Classes
    AnyRef → Any
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped