nlp

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DocumentClassify

func DocumentClassify(clt *core.Client, uid string, doc *DocumentClassifyRequest) (ret *model.DocumentClassify, err error)

DocumentClassify 给定文章内容,输出文章类别

func GetSimilarQuery

func GetSimilarQuery(clt *core.Client, uid string, q string) (ret []model.SimilarQuery, err error)

GetSimilarQuery 获取系统推荐的相似问题

func Ner

func Ner(clt *core.Client, uid string, q string) (ret []model.Ner, err error)

Ner 词法分析接口(只签名不加密)

func NewsAbstraction

func NewsAbstraction(clt *core.Client, uid string, news *NewsAbstractionRequest) (ret *model.NewsAbstraction, err error)

NewsAbstraction 本服务目前支持对输入新闻进行是否适合提取摘要的分类, 同时支持对给定新闻进行摘要自动提取

func Rank

func Rank(clt *core.Client, uid string, q string, candidates []string) (ret *model.RankResult, err error)

Rank 句子相似度计算以及排序

func RecChat

func RecChat(clt *core.Client, uid string) (ret []string, err error)

RecChat 给定文章内容,输出文章类别

func Sensitive

func Sensitive(clt *core.Client, uid string, q string, mode SensitiveMode) (ret map[string]float64, err error)

func Sentiment

func Sentiment(clt *core.Client, uid string, q string, mode SentimentMode) (ret map[string]float64, err error)

Ner 词法分析接口(只签名不加密)

func Sign

func Sign(clt *core.Client, uid string, data map[string]interface{}) (signature string, err error)

func Tokenize

func Tokenize(clt *core.Client, uid string, q string) (ret *model.TokenizeResult, err error)

Tokenize 词法分析接口(只签名不加密)

func Translate

func Translate(clt *core.Client, uid string, q string, to TranslateTo) (ret string, err error)

Translate 双向中英互译,输入一段中文翻译成英文,或输入一段英文翻译成中文

Types

type DocumentClassifyRequest

type DocumentClassifyRequest struct {
	Title   string `json:"title,omitempty"`
	Content string `json:"content,omitempty"`
}

type NewsAbstractionRequest

type NewsAbstractionRequest struct {
	Title          string `json:"title,omitempty"`
	Content        string `json:"content,omitempty"`
	Category       string `json:"category,omitempty"`
	DoNewsClassify bool   `json:"do_news_classify,omitempty"`
}

type SensitiveMode

type SensitiveMode = string
const (
	CNN  SensitiveMode = "cnn"
	BERT SensitiveMode = "bert"
)

type SentimentMode

type SentimentMode = string
const (
	CLASS3 SentimentMode = "3class"
	CLASS6 SentimentMode = "6class"
)

type TranslateTo

type TranslateTo = string
const (
	TO_EN TranslateTo = "cn2en"
	TO_CN TranslateTo = "en2cn"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL