Documentation ¶
Index ¶
Constants ¶
View Source
const ( CensorTextConclusionTypePass = 1 // 合规 CensorTextConclusionTypeIllegal = 2 // 不合规 CensorTextConclusionTypeSuspected = 3 // 疑似 CensorTextConclusionTypeFail = 4 // 失败 )
审核结果
View Source
const AccessTokenUrl = "https://aip.baidubce.com/oauth/2.0/token"
View Source
const CensorTextURL = "https://aip.baidubce.com/rest/2.0/solution/v1/text_censor/v2/user_defined"
View Source
const TransTextURL = "https://aip.baidubce.com/rpc/2.0/mt/texttrans/v1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CensorTextParams ¶
type CensorTextResponse ¶
type CensorTextResponseDataHitsItem ¶
type CensorTextResponseDataHitsItem struct { Probability string `json:"probability"` DatasetName string `json:"datasetName"` Words []string `json:"words"` Details interface{} `json:"details"` ModelHitPositions interface{} `json:"modelHitPositions"` WordHitPositions interface{} `json:"wordHitPositions"` }
type CensorTextResponseDataItem ¶
type CensorTextResponseDataItem struct { Type int `json:"type"` SubType int `json:"subType"` Msg string `json:"msg"` Hits []*CensorTextResponseDataHitsItem `json:"hits"` }
type Config ¶
type Config struct { entity.ConfigBaidu AccessToken string AccessTokenExpireIn int64 }
type TransTextParams ¶
type TransTextResponse ¶
type TransTextResponse struct { LogId string `json:"log_id"` Result *TransTextResponseResult `json:"result"` ErrorMsg string `json:"error_msg"` ErrorCode string `json:"error_code"` }
type TransTextResponseResult ¶
type TransTextResponseResult struct { From string `json:"from"` To string `json:"to"` TransResult []*TransTextResponseTransResult `json:"trans_result"` }
Click to show internal directories.
Click to hide internal directories.