Emotext Golang SDK: a client to emotext.
🔑 This is a muli component. You can find the main repository here.
Install:
go get github.com/murchinroom/emotextcligo
Example:
package main
import (
"fmt"
"github.com/murchinroom/emotextcligo"
)
func main() {
// emotextcligo.EmotextServer = "http://localhost:51061" or set env EMOTEXT_SERVER
text := "抱歉,今天很开心!"
res, err := emotextcligo.Query(text)
if err != nil {
panic(err)
}
// res.Emotions = emotextcligo.Emotions21To7(res.Emotions)
fmt.Println("Emotions:", res.Emotions)
fmt.Println("Polarity:", res.Polarity)
}
MIT