github.com/weaviate/weaviate@v1.24.6/modules/ner-transformers/additional/tokens/tokens_graphql_field.go (about)

     1  //                           _       _
     2  // __      _____  __ ___   ___  __ _| |_ ___
     3  // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
     4  //  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
     5  //   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
     6  //
     7  //  Copyright © 2016 - 2024 Weaviate B.V. All rights reserved.
     8  //
     9  //  CONTACT: hello@weaviate.io
    10  //
    11  
    12  package tokens
    13  
    14  import (
    15  	"fmt"
    16  
    17  	"github.com/tailor-inc/graphql"
    18  	"github.com/weaviate/weaviate/adapters/handlers/graphql/descriptions"
    19  )
    20  
    21  func (p *TokenProvider) additionalTokensField(classname string) *graphql.Field {
    22  	return &graphql.Field{
    23  		Args: graphql.FieldConfigArgument{
    24  			"properties": &graphql.ArgumentConfig{
    25  				Description:  "Properties which contains text",
    26  				Type:         graphql.NewList(graphql.String),
    27  				DefaultValue: nil,
    28  			},
    29  			"certainty": &graphql.ArgumentConfig{
    30  				Description:  descriptions.Certainty,
    31  				Type:         graphql.Float,
    32  				DefaultValue: nil,
    33  			},
    34  			"distance": &graphql.ArgumentConfig{
    35  				Description:  descriptions.Distance,
    36  				Type:         graphql.Float,
    37  				DefaultValue: nil,
    38  			},
    39  			"limit": &graphql.ArgumentConfig{
    40  				Type:         graphql.Int,
    41  				Description:  descriptions.Limit,
    42  				DefaultValue: nil,
    43  			},
    44  		},
    45  		Type: graphql.NewList(graphql.NewObject(graphql.ObjectConfig{
    46  			Name: fmt.Sprintf("%sAdditionalTokens", classname),
    47  			Fields: graphql.Fields{
    48  				"property":      &graphql.Field{Type: graphql.String},
    49  				"entity":        &graphql.Field{Type: graphql.String},
    50  				"certainty":     &graphql.Field{Type: graphql.Float},
    51  				"distance":      &graphql.Field{Type: graphql.Float},
    52  				"word":          &graphql.Field{Type: graphql.String},
    53  				"startPosition": &graphql.Field{Type: graphql.Int},
    54  				"endPosition":   &graphql.Field{Type: graphql.Int},
    55  			},
    56  		})),
    57  	}
    58  }