googlenl

package
v0.0.0-...-8a3d196 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KnowledgeGraphClient *kgsearch.Service
View Source
var NLUClient *language.Client

Functions

func AnalyzeEntities

func AnalyzeEntities(ctx context.Context, text string) (*languagepb.AnalyzeEntitiesResponse, error)

func AnalyzeSyntax

func AnalyzeSyntax(ctx context.Context, text string) (*languagepb.AnnotateTextResponse, error)

func ClassifyText

func ClassifyText(ctx context.Context, text string) (*languagepb.ClassifyTextResponse, error)

func Init

func Init(apikey string) error

func ModerateText

func ModerateText(ctx context.Context, text string, documentType languagepb.Document_Type) (*languagepb.ModerateTextResponse, error)

Types

type DetailedDescription

type DetailedDescription struct {
	ArticleBody string `json:"articleBody"`
	License     string `json:"license"`
	Url         string `json:"url"`
}

type EntityImage

type EntityImage struct {
	ContentUrl string `json:"contentUrl"`
	Url        string `json:"url"`
}

type KnowledgeGraphSearchResponse

type KnowledgeGraphSearchResponse struct {
	ItemListElement []*SearchResult `json:"itemListElement,omitempty"`
}

func SearchKnowledgeGraph

func SearchKnowledgeGraph(query string) (*KnowledgeGraphSearchResponse, error)

func SearchKnowledgeGraphByIds

func SearchKnowledgeGraphByIds(ids ...string) (*KnowledgeGraphSearchResponse, error)

type SearchResult

type SearchResult struct {
	Type        string             `json:"@type"`
	Result      SearchResultEntity `json:"result"`
	ResultScore float64            `json:"resultScore"`
}

type SearchResultEntity

type SearchResultEntity struct {
	Id                  string              `json:"@id"`
	Type                []string            `json:"@type"`
	Name                string              `json:"name"`
	Image               EntityImage         `json:"image"`
	DetailedDescription DetailedDescription `json:"detailedDescription"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL