https://github.com/ndthuan/go-vi-wordseg-client
Go client library for the ndthuan/vi-word-segmenter service
https://github.com/ndthuan/go-vi-wordseg-client
golang golang-library natural-language-processing pos-tagger pos-tagging vietnamese-language vietnamese-nlp vietnamese-tokenizer word-segmentation word-segmenter
Last synced: 2 months ago
JSON representation
Go client library for the ndthuan/vi-word-segmenter service
- Host: GitHub
- URL: https://github.com/ndthuan/go-vi-wordseg-client
- Owner: ndthuan
- License: gpl-3.0
- Created: 2020-04-05T16:17:59.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-06T00:38:42.000Z (over 5 years ago)
- Last Synced: 2025-06-05T21:45:31.754Z (5 months ago)
- Topics: golang, golang-library, natural-language-processing, pos-tagger, pos-tagging, vietnamese-language, vietnamese-nlp, vietnamese-tokenizer, word-segmentation, word-segmenter
- Language: Go
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-vi-wordseg-client
Go client library for the Vietnamese word segmenter service https://github.com/ndthuan/vi-word-segmenter.Supported versions: Go 1.12 and newer.
# Testing Prerequisites
* Docker on local machine and docker-compose
* GNU make## How to run tests
```shell script
make test
```## How to run examples
```shell script
make examples
```# Usage
```go
package mainimport (
"fmt"
"github.com/ndthuan/go-vi-wordseg-client/pkg/apiv1"
)func main() {
c := apiv1.NewClient("http://segmenterv1:8080")tagged, err := c.Tag("Việt Nam tổng tấn công COVID!")
if err != nil {
panic(err)
}println("Word-segmented text with tagging:")
for _, sentence := range tagged.Sentences {
for _, word := range sentence {
fmt.Printf("form=%s pos=%s ner=%s dep=%s\n", word.Form, word.Pos, word.Ner, word.Dep)
}
}
}
```Should output:
```text
Word-segmented text with tagging:
form=Việt_Nam pos=Np ner=B-PER dep=sub
form=tổng_tấn_công pos=V ner=O dep=root
form=COVID pos=Ny ner=O dep=dob
form=! pos=CH ner=O dep=punct
```