Skip to content

adamdecaf/deepparse-go

Repository files navigation

deepparse-go

GoDoc Build Status Coverage Status Go Report Card MIT License

Go client for GRAAL-Research/deepparse's HTTP API.

Usage

Import the Go library and create a client to start parsing addresses. Requires a running instance of deepparse.

httpClient := &http.Client{
	Timeout: 5 * time.Second,
}
cc := NewClient(httpClient, "http://localhost:8000")

ctx := context.Background()
resp, err := cc.ParseAddresses(ctx, ModelBPEmbAttention, []string{
	"350 rue des Lilas Ouest Quebec city Quebec G1L 1B6",
	"2325 Rue de l'Université, Québec, QC G1V 0A6",
})

// handle resp.Addresses

Contributing

The tests require pulling the ghcr.io/graal-research/deepparse image.

Pull and start the container before running Go tests:

$ docker compose up -d # takes a while to download and load data
$ go test ./...
ok  	github.com/adamdecaf/deepparse-go	0.773s

License

MIT Licensed