-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: only run Go tests when Go files change, update readme
- Loading branch information
Showing
2 changed files
with
79 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: 'CI' | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ master ] | ||
pull_request: {} | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
pull-requests: read | ||
|
||
jobs: | ||
detect_changes: | ||
name: Detect file changes | ||
runs-on: ubuntu-latest | ||
outputs: | ||
go_changes: ${{ steps.go_changes.outputs.src }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: dorny/paths-filter@v3 | ||
id: go_changes | ||
with: | ||
filters: | | ||
src: | ||
- go.mod | ||
- '**/*.go' | ||
go: | ||
needs: detect_changes | ||
if: ${{ needs.detect_changes.outputs.go_changes == 'true' }} | ||
uses: ./.github/workflows/go.yml | ||
name: Go Tests | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,48 @@ | ||
# deepparse-go | ||
|
||
Go client for GRAAL-Research/deepparse | ||
[](https://godoc.org/github.com/adamdecaf/deepparse-go) | ||
[](https://github.com/adamdecaf/deepparse-go/actions) | ||
[](https://codecov.io/gh/adamdecaf/deepparse-go) | ||
[](https://goreportcard.com/report/github.com/adamdecaf/deepparse-go) | ||
[](https://raw.githubusercontent.com/adamdecaf/deepparse-go/master/LICENSE) | ||
|
||
|
||
https://github.com/GRAAL-Research/deepparse | ||
Go client for [GRAAL-Research/deepparse](https://github.com/GRAAL-Research/deepparse)'s [HTTP API](https://deepparse.org/api.html). | ||
|
||
https://github.com/GRAAL-Research/deepparse/pkgs/container/deepparse | ||
## Usage | ||
|
||
Import the Go library and create a client to start parsing addresses. Requires a running instance of deepparse. | ||
|
||
```go | ||
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](https://github.com/GRAAL-Research/deepparse/pkgs/container/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 |