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()
- Alphabetic
- By Inheritance
- Gliner2SchemaBuilder
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Gliner2SchemaBuilder()
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
build(): Gliner2Schema
Build final schema output.
Build final schema output.
- returns
SchemaOutput containing the complete typed schema
-
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
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
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
-
def
entities(entityType: String): Gliner2SchemaBuilder
Add single entity extraction task.
Add single entity extraction task.
- entityType
Entity name
- returns
This schema for chaining
-
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
-
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
-
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
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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()
-
def
hashCode(): Int
- 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()
-
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
-
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
-
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
-
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
-
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
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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()