nlp

package
v0.0.0-...-2439577 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNKNOWN_INTENT          = 0
	LYRICS_INTENT           = 1
	DOWNLOAD_INTENT         = 2
	INSTRUMENT_INTENT       = 3
	MUSIC_INTENT            = 4
	NAME_INTENT             = 5
	TIME_INTENT             = 6
	LOCATION_INTENT         = 7
	STYLE_INTENT            = 8
	NUMBER_INTENT           = 9
	VIDEO_INTENT            = 10
	NATION_INTENT           = 11
	ALBUM_INTENT            = 12
	ORDER_INTENT            = 13
	VARIETY_INTENT          = 14
	BAND_INTENT             = 15
	SCENIC_INTENT           = 16
	MOVIE_INTENT            = 17
	TV_INTENT               = 18
	WIKI_INTENT             = 19
	STOCK_NAME_INTENT       = 34
	STOCK_CODE_INTENT       = 35
	INDEX_INDENT            = 36
	PRICE_INTENT            = 37
	INSIGHT_INTENT          = 38
	MOUNTAIN_INTENT         = 40
	LAKE_INTENT             = 41
	WETHER_INTENT           = 42
	RESTAURANT_INTENT       = 43
	DISH_NAME_INTENT        = 44
	RHYMES_INTENT           = 45
	STORY_INTENT            = 46
	CROSS_TALK_INTENT       = 47
	STORYTELLING_INTENT     = 48
	AUDIO_BOOK_INTENT       = 49
	CATEGORY_WORD_INTENT    = 128
	RELATION_WORD_INTENT    = 129
	CONTRACTION_WORD_INTENT = 130
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ComToken

type ComToken struct {
	Type ComType `json:"com_type,omitempty"` // 成分编码
	Word string  `json:"com_word,omitempty"` // 成分分词
}

type ComType

type ComType = int
const (
	UNKNOWN_COM ComType = 0
	WEATHER_COM ComType = 1
	MUSIC_COM   ComType = 2
	STOCK_COMP  ComType = 3
	NEWS_COMP   ComType = 4
)

type IntentType

type IntentType = int

type PolarType

type PolarType = int
const (
	NEGTIVE_POLAR  PolarType = -1
	NEUTRAL_POLAR  PolarType = 0
	POSITIVE_POLAR PolarType = 1
)

type TextchatRequest

type TextchatRequest struct {
	Session  string `json:"session"`
	Question string `json:"question"` // 用户输入的聊天内容
}

func (*TextchatRequest) Method

func (this *TextchatRequest) Method() string

func (*TextchatRequest) Path

func (this *TextchatRequest) Path() string

func (*TextchatRequest) Values

func (this *TextchatRequest) Values() url.Values

type TextchatResponse

type TextchatResponse struct {
	Session string `json:"session,omitempty"`
	Answer  string `json:"answer,omitempty"`
}

func Textchat

func Textchat(clt *aiqq.Client, question string, session string) (*TextchatResponse, error)

type TextpolarRequest

type TextpolarRequest struct {
	Text string `json:"text"` // 待分析文本
}

func (*TextpolarRequest) Method

func (this *TextpolarRequest) Method() string

func (*TextpolarRequest) Path

func (this *TextpolarRequest) Path() string

func (*TextpolarRequest) Values

func (this *TextpolarRequest) Values() url.Values

type TextpolarResponse

type TextpolarResponse struct {
	Text  string    `json:"text,omitempty"`  // API请求中的待分析文本
	Polar PolarType `json:"polar,omitempty"` // 情感编码
	Confd float64   `json:"confd,omitempty"` // 置信度
}

func Textpolar

func Textpolar(clt *aiqq.Client, text string) (*TextpolarResponse, error)

type WordcomRequest

type WordcomRequest struct {
	Text string `json:"text"` // 待分析文本
}

func (*WordcomRequest) Method

func (this *WordcomRequest) Method() string

func (*WordcomRequest) Path

func (this *WordcomRequest) Path() string

func (*WordcomRequest) Values

func (this *WordcomRequest) Values() url.Values

type WordcomResponse

type WordcomResponse struct {
	Text      string     `json:"text,omitempty"`       // API请求中的待分析文本
	Intent    IntentType `json:"intent,omitempty"`     // 意图编码
	ComTokens []ComToken `json:"com_tokens,omitempty"` // 成分列表
}

func Wordcom

func Wordcom(clt *aiqq.Client, text string) (*WordcomResponse, error)

Jump to

Keyboard shortcuts

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