Golang RESTful API

Install

go get -u github.com/hankcs/gohanlp@main

Quick Start

Obtain an auth from any compatible service provider like our free service, then initiate a HanLPClient and call its Parse interface.

package main

import (
	"fmt"
	"github.com/hankcs/gohanlp/hanlp"
)

func main() {
    client := hanlp.HanLPClient(hanlp.WithAuth("The auth you applied for")) // anonymous users can skip auth
    s, _ := client.Parse("In 2021, HanLPv2.1 delivers state-of-the-art multilingual NLP techniques to production environments.",hanlp.WithLanguage("mul"))
    fmt.Println(s)
}

Refer to our testcases and data format for more details.