Skip to content

ceh137/spacy_go_client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go client For SpaCy Server

A basic Client for SpaCy API Server implemented in Go

Notes:

Installation:

Run Go get to download this package:

go get github.com/ceh137/spacy_go_client 

Import package into files you would like to use in:

package main

import (
	spy "github.com/ceh137/spacy_go_client"
)

Usage

Two simple steps:

  • Create SpacyClient.
  • Use it to call methods
func main() {
	sc := spy.SpacyClient{
		Model: spy.EnModel,
		Url:   "localhost:8080",
	}
	
	sentDeps, _ := sc.GetSentDeps("Some text")
	ents, _ := sc.GetEnts("Some text")
	deps, _ := sc.GetDeps("Some text", true, true)
}

Available Methods And Constants

To understand the terminology better please refer to the original SpaCy Documentation

Feel free to use these constants to set the model in your client:

const (
	EnModel = "en"
	DeModel = "de"
	EsModel = "es"
	FrModel = "fr"
	PtModel = "pt"
	ItModel = "it"
	NlModel = "nl"
)

sc.GetSentDeps(text string)

Returns Sentences and Dependency parses


sc.GetSents(text string)

Returns Sentences from text


sc.GetEnts(text string)

Returns Entities found in text


sc.GetDeps(text string)

Returns Dependencies found in text


sc.GetVersion()

Returns the version od spacy on your server


sc.GetModels()

Returns available on your server models

About

Golang Client for SpaCy Server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages