Packages

c

com.johnsnowlabs.nlp.annotators.ner

Gliner2PreprocessedBatch

case class Gliner2PreprocessedBatch(inputIds: Array[Array[Long]], attentionMask: Array[Array[Long]], mappedIndices: Array[Array[(String, Int, Int)]], schemaCounts: Array[Int], originalLengths: Array[Int], taskTypes: Array[Array[String]], wordTokens: Array[Array[String]], schemaTokensList: Array[Array[Array[String]]], startMappings: Array[Array[Int]], endMappings: Array[Array[Int]], originalTexts: Array[String], originalSchemas: Array[Gliner2Schema], structureLabels: Array[Any] = Array.empty) extends Product with Serializable

Batch of preprocessed inputs ready for ONNX encoder. Maps 1:1 to Python's PreprocessedBatch.

This is the output of Gliner2DataProcessor.prepareInputs() and the input to the ONNX encoder model.

inputIds

Token IDs for encoder input (batch, max_seq_len)

attentionMask

Attention mask for encoder (batch, max_seq_len)

mappedIndices

Token mappings: (seg_type, orig_idx, schema_idx)

  • seg_type: "schema" or "text"
  • orig_idx: Original token index in text or schema
  • schema_idx: Which schema this token belongs to (for schema tokens)
schemaCounts

Number of schemas per sample

originalLengths

Original sequence lengths per sample

taskTypes

Task types per schema per sample

wordTokens

Original text tokens per sample

schemaTokensList

Schema tokens per sample

startMappings

Token char start positions per sample

endMappings

Token char end positions per sample

originalTexts

Original text strings

originalSchemas

Original schema dictionaries

structureLabels

Ground truth labels (training only, can be empty for inference)

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Gliner2PreprocessedBatch
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Gliner2PreprocessedBatch(inputIds: Array[Array[Long]], attentionMask: Array[Array[Long]], mappedIndices: Array[Array[(String, Int, Int)]], schemaCounts: Array[Int], originalLengths: Array[Int], taskTypes: Array[Array[String]], wordTokens: Array[Array[String]], schemaTokensList: Array[Array[Array[String]]], startMappings: Array[Array[Int]], endMappings: Array[Array[Int]], originalTexts: Array[String], originalSchemas: Array[Gliner2Schema], structureLabels: Array[Any] = Array.empty)

    inputIds

    Token IDs for encoder input (batch, max_seq_len)

    attentionMask

    Attention mask for encoder (batch, max_seq_len)

    mappedIndices

    Token mappings: (seg_type, orig_idx, schema_idx)

    • seg_type: "schema" or "text"
    • orig_idx: Original token index in text or schema
    • schema_idx: Which schema this token belongs to (for schema tokens)
    schemaCounts

    Number of schemas per sample

    originalLengths

    Original sequence lengths per sample

    taskTypes

    Task types per schema per sample

    wordTokens

    Original text tokens per sample

    schemaTokensList

    Schema tokens per sample

    startMappings

    Token char start positions per sample

    endMappings

    Token char end positions per sample

    originalTexts

    Original text strings

    originalSchemas

    Original schema dictionaries

    structureLabels

    Ground truth labels (training only, can be empty for inference)

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. val attentionMask: Array[Array[Long]]
  6. def batchSize: Int

    Number of samples in this batch.

  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  8. val endMappings: Array[Array[Int]]
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. val inputIds: Array[Array[Long]]
  13. def isEmpty: Boolean

    Check if batch is empty.

  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. val mappedIndices: Array[Array[(String, Int, Int)]]
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. val originalLengths: Array[Int]
  20. val originalSchemas: Array[Gliner2Schema]
  21. val originalTexts: Array[String]
  22. val schemaCounts: Array[Int]
  23. val schemaTokensList: Array[Array[Array[String]]]
  24. val startMappings: Array[Array[Int]]
  25. val structureLabels: Array[Any]
  26. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  27. val taskTypes: Array[Array[String]]
  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  31. val wordTokens: Array[Array[String]]

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped