Documentation ¶
Index ¶
- Constants
- type AutoSummarizationRequest
- type AutoSummarizationResponse
- type CCIToken
- type ClassificationResult
- type Client
- func (c *Client) AutoSummarization(request *AutoSummarizationRequest) (response *AutoSummarizationResponse, err error)
- func (c *Client) ContentApproval(request *ContentApprovalRequest) (response *ContentApprovalResponse, err error)
- func (c *Client) DependencyParsing(request *DependencyParsingRequest) (response *DependencyParsingResponse, err error)
- func (c *Client) KeywordsExtraction(request *KeywordsExtractionRequest) (response *KeywordsExtractionResponse, err error)
- func (c *Client) LexicalAnalysis(request *LexicalAnalysisRequest) (response *LexicalAnalysisResponse, err error)
- func (c *Client) SensitiveWordsRecognition(request *SensitiveWordsRecognitionRequest) (response *SensitiveWordsRecognitionResponse, err error)
- func (c *Client) SentenceEmbedding(request *SentenceEmbeddingRequest) (response *SentenceEmbeddingResponse, err error)
- func (c *Client) SentenceSimilarity(request *SentenceSimilarityRequest) (response *SentenceSimilarityResponse, err error)
- func (c *Client) SentimentAnalysis(request *SentimentAnalysisRequest) (response *SentimentAnalysisResponse, err error)
- func (c *Client) SimilarWords(request *SimilarWordsRequest) (response *SimilarWordsResponse, err error)
- func (c *Client) TextApproval(request *TextApprovalRequest) (response *TextApprovalResponse, err error)
- func (c *Client) TextClassification(request *TextClassificationRequest) (response *TextClassificationResponse, err error)
- func (c *Client) TextCorrection(request *TextCorrectionRequest) (response *TextCorrectionResponse, err error)
- func (c *Client) WordEmbedding(request *WordEmbeddingRequest) (response *WordEmbeddingResponse, err error)
- func (c *Client) WordSimilarity(request *WordSimilarityRequest) (response *WordSimilarityResponse, err error)
- type ContentApprovalRequest
- type ContentApprovalResponse
- type DependencyParsingRequest
- type DependencyParsingResponse
- type DpToken
- type EvilToken
- type Keyword
- type KeywordsExtractionRequest
- type KeywordsExtractionResponse
- type LexicalAnalysisRequest
- type LexicalAnalysisResponse
- type NerToken
- type PosToken
- type SensitiveWordsRecognitionRequest
- type SensitiveWordsRecognitionResponse
- type SentenceEmbeddingRequest
- type SentenceEmbeddingResponse
- type SentenceSimilarityRequest
- type SentenceSimilarityResponse
- type SentimentAnalysisRequest
- type SentimentAnalysisResponse
- type SimilarWordsRequest
- type SimilarWordsResponse
- type TextApprovalRequest
- type TextApprovalResponse
- type TextClassificationRequest
- type TextClassificationResponse
- type TextCorrectionRequest
- type TextCorrectionResponse
- type WordEmbeddingRequest
- type WordEmbeddingResponse
- type WordSimilarityRequest
- type WordSimilarityResponse
Constants ¶
const APIVersion = "2019-04-08"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoSummarizationRequest ¶
type AutoSummarizationRequest struct { *tchttp.BaseRequest // 待处理的文本(仅支持UTF-8格式,不超过2000字) Text *string `json:"Text,omitempty" name:"Text"` // 指定摘要的长度(默认值为200) // 注:为保证摘要的可读性,最终生成的摘要长度并不会严格遵循这个值,会有略微的浮动 Length *uint64 `json:"Length,omitempty" name:"Length"` }
func NewAutoSummarizationRequest ¶
func NewAutoSummarizationRequest() (request *AutoSummarizationRequest)
func (*AutoSummarizationRequest) FromJsonString ¶
func (r *AutoSummarizationRequest) FromJsonString(s string) error
func (*AutoSummarizationRequest) ToJsonString ¶
func (r *AutoSummarizationRequest) ToJsonString() string
type AutoSummarizationResponse ¶
type AutoSummarizationResponse struct { *tchttp.BaseResponse Response *struct { // 文本摘要结果 Summary *string `json:"Summary,omitempty" name:"Summary"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewAutoSummarizationResponse ¶
func NewAutoSummarizationResponse() (response *AutoSummarizationResponse)
func (*AutoSummarizationResponse) FromJsonString ¶
func (r *AutoSummarizationResponse) FromJsonString(s string) error
func (*AutoSummarizationResponse) ToJsonString ¶
func (r *AutoSummarizationResponse) ToJsonString() string
type ClassificationResult ¶
type ClassificationResult struct { // 一级分类名称 FirstClassName *string `json:"FirstClassName,omitempty" name:"FirstClassName"` // 一级分类概率 FirstClassProbability *float64 `json:"FirstClassProbability,omitempty" name:"FirstClassProbability"` // 二级分类名称 SecondClassName *string `json:"SecondClassName,omitempty" name:"SecondClassName"` // 二级分类概率 SecondClassProbability *float64 `json:"SecondClassProbability,omitempty" name:"SecondClassProbability"` }
type Client ¶
func NewClient ¶
func NewClient(credential *common.Credential, region string, clientProfile *profile.ClientProfile) (client *Client, err error)
func NewClientWithSecretId ¶
Deprecated
func (*Client) AutoSummarization ¶
func (c *Client) AutoSummarization(request *AutoSummarizationRequest) (response *AutoSummarizationResponse, err error)
利用人工智能算法,自动抽取文本中的关键信息并生成指定长度的文本摘要。可用于新闻标题生成、科技文献摘要生成和商品评论摘要等。
func (*Client) ContentApproval ¶
func (c *Client) ContentApproval(request *ContentApprovalRequest) (response *ContentApprovalResponse, err error)
(该接口即将下线,请使用升级接口:文本审核)
文本审核接口能够识别文本信息中的色情、政治等有害内容,帮助用户及时、精准地防范违规风险,可用于内容审核、敏感信息过滤、舆情监控等场景。
该功能基于10万级大规模敏感词库,结合多种文本对抗方法、政策权威指令等,并运用了深度学习技术,高效识别高危有害内容。同时我们会根据大规模语料和实时反误杀系统,不断更新迭代,确保效果持续提升。
文本审核接口目前提供以下三个功能:
1、文本恶意级别:将文本分为3个级别,包括正常、恶意、可疑送审;
2、文本恶意类型:把文本分为9个类别,包括正常、政治、色情、辱骂/低俗、暴恐/毒品、广告/灌水、迷信/邪教、其他违法、综合;
3、恶意关键词:文本中所有涉嫌恶意的关键词。
func (*Client) DependencyParsing ¶
func (c *Client) DependencyParsing(request *DependencyParsingRequest) (response *DependencyParsingResponse, err error)
句法依存分析接口能够分析出句子中词与词之间的相互依存关系,并揭示其句法结构,包括主谓关系、动宾关系、核心关系等等,可用于提取句子主干、提取句子核心词等,在机器翻译、自动问答、知识抽取等领域都有很好的应用。
func (*Client) KeywordsExtraction ¶
func (c *Client) KeywordsExtraction(request *KeywordsExtractionRequest) (response *KeywordsExtractionResponse, err error)
基于关键词提取平台,通过对文本内容进行深度分析,提取出文本内容中的关键信息,为用户实现诸如新闻内容关键词自动提取、评论关键词提取等提供基础服务。
func (*Client) LexicalAnalysis ¶
func (c *Client) LexicalAnalysis(request *LexicalAnalysisRequest) (response *LexicalAnalysisResponse, err error)
词法分析接口提供以下三个功能:
1、智能分词:将连续的自然语言文本,切分成具有语义合理性和完整性的词汇序列;
2、词性标注:为每一个词附上对应的词性,例如名词、代词、形容词、动词等;
3、命名实体识别:快速识别文本中的实体,例如人名、地名、机构名、时间日期等。
所有的功能均基于千亿级大规模互联网语料进行持续迭代更新,以保证效果不断提升,用户无需担心新词发现、歧义消除、调用性能等问题。目前词法分析已经在泛互联网、金融、政务等不同垂直领域提供业务支持,并取得良好的效果。
func (*Client) SensitiveWordsRecognition ¶
func (c *Client) SensitiveWordsRecognition(request *SensitiveWordsRecognitionRequest) (response *SensitiveWordsRecognitionResponse, err error)
敏感词识别接口能够识别出文本中的所有敏感词,帮助用户及时、精准地防范违规风险,广泛用于各种高危涉敏场景(如资讯、评论、聊天室)的敏感信息过滤。
该功能基于10万级大规模敏感词库,结合多种文本对抗方法、政策权威指令等,高效识别敏感词及其各类变种。同时我们会根据大规模语料和实时反误杀系统,不断更新迭代,确保效果持续提升。
目前能够支持对政治、色情、辱骂/低俗、暴恐/毒品、广告/灌水、迷信/邪教、其他违法、综合等8大类敏感信息的识别。
func (*Client) SentenceEmbedding ¶
func (c *Client) SentenceEmbedding(request *SentenceEmbeddingRequest) (response *SentenceEmbeddingResponse, err error)
句向量接口能够将输入的句子映射成一个固定维度的向量,用来表示这个句子的语义特征,可用于文本聚类、文本相似度、文本分类等任务,能够显著提高它们的效果。
该句向量服务由腾讯知文自然语言处理团队联合腾讯AI Lab共同打造,基于千亿级大规模互联网语料并采用AI Lab自研的DSG算法训练而成,在腾讯内部诸多业务的NLP任务上实测效果显著。
func (*Client) SentenceSimilarity ¶
func (c *Client) SentenceSimilarity(request *SentenceSimilarityRequest) (response *SentenceSimilarityResponse, err error)
文本相似度接口能够基于深度学习技术来计算两个输入文本的相似度,相似度数值越大的两个文本在语义上越相似。目前仅支持短文本的相似度计算,长文本的相似度计算也即将推出。
鉴于文本相似度是一个应用非常广泛的功能,腾讯知文自然语言处理团队在深度神经网络模型的基础上,专门针对文本相似任务进行了优化,并持续迭代更新。基于文本相似度,可以轻松实现诸如文本去重、相似推荐等功能。
func (*Client) SentimentAnalysis ¶
func (c *Client) SentimentAnalysis(request *SentimentAnalysisRequest) (response *SentimentAnalysisResponse, err error)
情感分析接口能够对带有情感色彩的主观性文本进行分析、处理、归纳和推理,识别出用户的情感倾向,是积极还是消极,并且提供各自概率。
该功能基于基于千亿级大规模互联网语料和LSTM、BERT等深度神经网络模型进行训练,并持续迭代更新,以保证效果不断提升。
func (*Client) SimilarWords ¶
func (c *Client) SimilarWords(request *SimilarWordsRequest) (response *SimilarWordsResponse, err error)
相似词接口能够基于同义词库及词向量技术,检索出与输入词语在语义上最相似的若干个词语,可广泛用于检索系统、问答系统、文档归档等场景。
func (*Client) TextApproval ¶
func (c *Client) TextApproval(request *TextApprovalRequest) (response *TextApprovalResponse, err error)
文本审核接口能够识别文本信息中的色情、政治等有害内容,帮助用户及时、精准地防范违规风险,可用于内容审核、敏感信息过滤、舆情监控等场景。
该功能基于10万级大规模敏感词库,结合多种文本对抗方法、政策权威指令等,并运用了深度学习技术,高效识别高危有害内容。同时我们会根据大规模语料和实时反误杀系统,不断更新迭代,确保效果持续提升。
文本审核接口目前提供以下三个功能:
1、文本恶意级别:将文本分为3个级别,包括正常、恶意、可疑送审;
2、文本恶意类型:把文本分为9个类别,包括正常、政治、色情、辱骂/低俗、暴恐/毒品、广告/灌水、迷信/邪教、其他违法、综合;
3、恶意关键词:文本中所有涉嫌恶意的关键词。
func (*Client) TextClassification ¶
func (c *Client) TextClassification(request *TextClassificationRequest) (response *TextClassificationResponse, err error)
文本分类接口能够对用户输入的文本进行自动分类,将其映射到具体的类目上,用户只需要提供待分类的文本,而无需关注具体实现。
该功能基于基于千亿级大规模互联网语料和LSTM、BERT等深度神经网络模型进行训练,并持续迭代更新,以保证效果不断提升。
目前已提供:
- 通用领域分类体系,包括15个分类类目,分别是汽车、科技、健康、体育、旅行、教育、职业、文化、军事、房产、娱乐、女性、奥运、财经以及其他,适用于通用的场景。
- 新闻领域分类体系,包括37个一级分类类目,285个二级分类,已应用于腾讯新闻的文章分类。
更多垂直领域的分类体系即将推出,敬请期待。
func (*Client) TextCorrection ¶
func (c *Client) TextCorrection(request *TextCorrectionRequest) (response *TextCorrectionResponse, err error)
提供对中文文本的自动纠错功能,能够识别输入文本中的错误片段,定位错误并给出正确的文本结果;支持长度不超过2000字的长文本纠错。
此功能是基于千亿级大规模互联网语料和LSTM、BERT等深度神经网络模型进行训练,并持续迭代更新,以保证效果不断提升,是搜索引擎、语音识别、内容审核等功能更好运行的基础之一。
func (*Client) WordEmbedding ¶
func (c *Client) WordEmbedding(request *WordEmbeddingRequest) (response *WordEmbeddingResponse, err error)
词向量接口能够将输入的词语映射成一个固定维度的词向量,用来表示这个词语的语义特征。词向量是很多自然语言处理技术的基础,能够显著提高它们的效果。
该词向量服务由腾讯知文自然语言处理团队联合腾讯AI Lab共同打造。使用的词向量基于千亿级大规模互联网语料并采用AI Lab自研的DSG算法训练而成,开源的词向量包含800多万中文词汇,在覆盖率、新鲜度及准确性等三方面性能突出。
腾讯AI Lab词向量相关资料:
func (*Client) WordSimilarity ¶
func (c *Client) WordSimilarity(request *WordSimilarityRequest) (response *WordSimilarityResponse, err error)
词相似度接口能够基于词向量技术来计算两个输入词语的余弦相似度,相似度数值越大的两个词语在语义上越相似。
type ContentApprovalRequest ¶
type ContentApprovalRequest struct { *tchttp.BaseRequest // 待审核的文本(仅支持UTF-8格式,不超过2000字) Text *string `json:"Text,omitempty" name:"Text"` }
func NewContentApprovalRequest ¶
func NewContentApprovalRequest() (request *ContentApprovalRequest)
func (*ContentApprovalRequest) FromJsonString ¶
func (r *ContentApprovalRequest) FromJsonString(s string) error
func (*ContentApprovalRequest) ToJsonString ¶
func (r *ContentApprovalRequest) ToJsonString() string
type ContentApprovalResponse ¶
type ContentApprovalResponse struct { *tchttp.BaseResponse Response *struct { // 文本是否恶意: // 0、正常; // 1、恶意; // 2、可疑送审 EvilFlag *uint64 `json:"EvilFlag,omitempty" name:"EvilFlag"` // 恶意关键词组 EvilKeywords []*string `json:"EvilKeywords,omitempty" name:"EvilKeywords" list` // 文本恶意类型: // 0、正常; // 1、政治; // 2、色情; // 3、辱骂/低俗; // 4、暴恐/毒品; // 5、广告/灌水; // 6、迷信/邪教; // 7、其他违法(如跨站追杀/恶意竞争等); // 8、综合 EvilType *uint64 `json:"EvilType,omitempty" name:"EvilType"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewContentApprovalResponse ¶
func NewContentApprovalResponse() (response *ContentApprovalResponse)
func (*ContentApprovalResponse) FromJsonString ¶
func (r *ContentApprovalResponse) FromJsonString(s string) error
func (*ContentApprovalResponse) ToJsonString ¶
func (r *ContentApprovalResponse) ToJsonString() string
type DependencyParsingRequest ¶
type DependencyParsingRequest struct { *tchttp.BaseRequest // 待分析的文本(仅支持UTF-8格式,不超过200字) Text *string `json:"Text,omitempty" name:"Text"` }
func NewDependencyParsingRequest ¶
func NewDependencyParsingRequest() (request *DependencyParsingRequest)
func (*DependencyParsingRequest) FromJsonString ¶
func (r *DependencyParsingRequest) FromJsonString(s string) error
func (*DependencyParsingRequest) ToJsonString ¶
func (r *DependencyParsingRequest) ToJsonString() string
type DependencyParsingResponse ¶
type DependencyParsingResponse struct { *tchttp.BaseResponse Response *struct { // 句法依存分析结果 DpTokens []*DpToken `json:"DpTokens,omitempty" name:"DpTokens" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewDependencyParsingResponse ¶
func NewDependencyParsingResponse() (response *DependencyParsingResponse)
func (*DependencyParsingResponse) FromJsonString ¶
func (r *DependencyParsingResponse) FromJsonString(s string) error
func (*DependencyParsingResponse) ToJsonString ¶
func (r *DependencyParsingResponse) ToJsonString() string
type EvilToken ¶
type EvilToken struct { // 文本是否恶意: // 0、正常; // 1、恶意; // 2、可疑送审 EvilFlag *uint64 `json:"EvilFlag,omitempty" name:"EvilFlag"` // 恶意关键词组 EvilKeywords []*string `json:"EvilKeywords,omitempty" name:"EvilKeywords" list` // 文本恶意类型: // 0、正常; // 1、政治; // 2、色情; // 3、辱骂/低俗; // 4、暴恐/毒品; // 5、广告/灌水; // 6、迷信/邪教; // 7、其他违法(如跨站追杀/恶意竞争等); // 8、综合 EvilType *uint64 `json:"EvilType,omitempty" name:"EvilType"` }
type KeywordsExtractionRequest ¶
type KeywordsExtractionRequest struct { *tchttp.BaseRequest // 待处理的文本(仅支持UTF-8格式,不超过2000字) Text *string `json:"Text,omitempty" name:"Text"` // 指定关键词个数上限(默认值为5) Num *uint64 `json:"Num,omitempty" name:"Num"` }
func NewKeywordsExtractionRequest ¶
func NewKeywordsExtractionRequest() (request *KeywordsExtractionRequest)
func (*KeywordsExtractionRequest) FromJsonString ¶
func (r *KeywordsExtractionRequest) FromJsonString(s string) error
func (*KeywordsExtractionRequest) ToJsonString ¶
func (r *KeywordsExtractionRequest) ToJsonString() string
type KeywordsExtractionResponse ¶
type KeywordsExtractionResponse struct { *tchttp.BaseResponse Response *struct { // 关键词提取结果 Keywords []*Keyword `json:"Keywords,omitempty" name:"Keywords" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewKeywordsExtractionResponse ¶
func NewKeywordsExtractionResponse() (response *KeywordsExtractionResponse)
func (*KeywordsExtractionResponse) FromJsonString ¶
func (r *KeywordsExtractionResponse) FromJsonString(s string) error
func (*KeywordsExtractionResponse) ToJsonString ¶
func (r *KeywordsExtractionResponse) ToJsonString() string
type LexicalAnalysisRequest ¶
type LexicalAnalysisRequest struct { *tchttp.BaseRequest // 待分析的文本(仅支持UTF-8格式,不超过500字) Text *string `json:"Text,omitempty" name:"Text"` // 词法分析模式(默认取1值): // 1、高精度(具备混合粒度分词能力); // 2、高性能; Flag *uint64 `json:"Flag,omitempty" name:"Flag"` }
func NewLexicalAnalysisRequest ¶
func NewLexicalAnalysisRequest() (request *LexicalAnalysisRequest)
func (*LexicalAnalysisRequest) FromJsonString ¶
func (r *LexicalAnalysisRequest) FromJsonString(s string) error
func (*LexicalAnalysisRequest) ToJsonString ¶
func (r *LexicalAnalysisRequest) ToJsonString() string
type LexicalAnalysisResponse ¶
type LexicalAnalysisResponse struct { *tchttp.BaseResponse Response *struct { // 命名实体识别结果。取值范围: // <li>PER:表示人名</li> // <li>LOC:表示地名</li> // <li>ORG:表示机构团体名</li> NerTokens []*NerToken `json:"NerTokens,omitempty" name:"NerTokens" list` // 分词&词性标注结果(词性表请参见附录) PosTokens []*PosToken `json:"PosTokens,omitempty" name:"PosTokens" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewLexicalAnalysisResponse ¶
func NewLexicalAnalysisResponse() (response *LexicalAnalysisResponse)
func (*LexicalAnalysisResponse) FromJsonString ¶
func (r *LexicalAnalysisResponse) FromJsonString(s string) error
func (*LexicalAnalysisResponse) ToJsonString ¶
func (r *LexicalAnalysisResponse) ToJsonString() string
type SensitiveWordsRecognitionRequest ¶
type SensitiveWordsRecognitionRequest struct { *tchttp.BaseRequest // 待识别的文本(仅支持UTF-8格式,不超过2000字) Text *string `json:"Text,omitempty" name:"Text"` }
func NewSensitiveWordsRecognitionRequest ¶
func NewSensitiveWordsRecognitionRequest() (request *SensitiveWordsRecognitionRequest)
func (*SensitiveWordsRecognitionRequest) FromJsonString ¶
func (r *SensitiveWordsRecognitionRequest) FromJsonString(s string) error
func (*SensitiveWordsRecognitionRequest) ToJsonString ¶
func (r *SensitiveWordsRecognitionRequest) ToJsonString() string
type SensitiveWordsRecognitionResponse ¶
type SensitiveWordsRecognitionResponse struct { *tchttp.BaseResponse Response *struct { // 敏感词数组 SensitiveWords []*string `json:"SensitiveWords,omitempty" name:"SensitiveWords" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewSensitiveWordsRecognitionResponse ¶
func NewSensitiveWordsRecognitionResponse() (response *SensitiveWordsRecognitionResponse)
func (*SensitiveWordsRecognitionResponse) FromJsonString ¶
func (r *SensitiveWordsRecognitionResponse) FromJsonString(s string) error
func (*SensitiveWordsRecognitionResponse) ToJsonString ¶
func (r *SensitiveWordsRecognitionResponse) ToJsonString() string
type SentenceEmbeddingRequest ¶
type SentenceEmbeddingRequest struct { *tchttp.BaseRequest // 输入的文本(仅支持UTF-8格式,不超过500字) Text *string `json:"Text,omitempty" name:"Text"` }
func NewSentenceEmbeddingRequest ¶
func NewSentenceEmbeddingRequest() (request *SentenceEmbeddingRequest)
func (*SentenceEmbeddingRequest) FromJsonString ¶
func (r *SentenceEmbeddingRequest) FromJsonString(s string) error
func (*SentenceEmbeddingRequest) ToJsonString ¶
func (r *SentenceEmbeddingRequest) ToJsonString() string
type SentenceEmbeddingResponse ¶
type SentenceEmbeddingResponse struct { *tchttp.BaseResponse Response *struct { // 句向量的维度 Dimension *uint64 `json:"Dimension,omitempty" name:"Dimension"` // 句向量数组 Vector []*float64 `json:"Vector,omitempty" name:"Vector" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewSentenceEmbeddingResponse ¶
func NewSentenceEmbeddingResponse() (response *SentenceEmbeddingResponse)
func (*SentenceEmbeddingResponse) FromJsonString ¶
func (r *SentenceEmbeddingResponse) FromJsonString(s string) error
func (*SentenceEmbeddingResponse) ToJsonString ¶
func (r *SentenceEmbeddingResponse) ToJsonString() string
type SentenceSimilarityRequest ¶
type SentenceSimilarityRequest struct { *tchttp.BaseRequest // 计算相似度的源句子(仅支持UTF-8格式,不超过500字) SrcText *string `json:"SrcText,omitempty" name:"SrcText"` // 计算相似度的目标句子(仅支持UTF-8格式,不超过500字) TargetText *string `json:"TargetText,omitempty" name:"TargetText"` }
func NewSentenceSimilarityRequest ¶
func NewSentenceSimilarityRequest() (request *SentenceSimilarityRequest)
func (*SentenceSimilarityRequest) FromJsonString ¶
func (r *SentenceSimilarityRequest) FromJsonString(s string) error
func (*SentenceSimilarityRequest) ToJsonString ¶
func (r *SentenceSimilarityRequest) ToJsonString() string
type SentenceSimilarityResponse ¶
type SentenceSimilarityResponse struct { *tchttp.BaseResponse Response *struct { // 两个文本的相似度 Similarity *float64 `json:"Similarity,omitempty" name:"Similarity"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewSentenceSimilarityResponse ¶
func NewSentenceSimilarityResponse() (response *SentenceSimilarityResponse)
func (*SentenceSimilarityResponse) FromJsonString ¶
func (r *SentenceSimilarityResponse) FromJsonString(s string) error
func (*SentenceSimilarityResponse) ToJsonString ¶
func (r *SentenceSimilarityResponse) ToJsonString() string
type SentimentAnalysisRequest ¶
type SentimentAnalysisRequest struct { *tchttp.BaseRequest // 待分析的文本(仅支持UTF-8格式,不超过200字) Text *string `json:"Text,omitempty" name:"Text"` // 文本所属类型(默认取4值): // 1、电商 // 2、APP // 3、美食 // 4、酒店和其他 Flag *uint64 `json:"Flag,omitempty" name:"Flag"` }
func NewSentimentAnalysisRequest ¶
func NewSentimentAnalysisRequest() (request *SentimentAnalysisRequest)
func (*SentimentAnalysisRequest) FromJsonString ¶
func (r *SentimentAnalysisRequest) FromJsonString(s string) error
func (*SentimentAnalysisRequest) ToJsonString ¶
func (r *SentimentAnalysisRequest) ToJsonString() string
type SentimentAnalysisResponse ¶
type SentimentAnalysisResponse struct { *tchttp.BaseResponse Response *struct { // 负面情感概率 Negative *float64 `json:"Negative,omitempty" name:"Negative"` // 正面情感概率 Positive *float64 `json:"Positive,omitempty" name:"Positive"` // 情感属性 Sentiment *string `json:"Sentiment,omitempty" name:"Sentiment"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewSentimentAnalysisResponse ¶
func NewSentimentAnalysisResponse() (response *SentimentAnalysisResponse)
func (*SentimentAnalysisResponse) FromJsonString ¶
func (r *SentimentAnalysisResponse) FromJsonString(s string) error
func (*SentimentAnalysisResponse) ToJsonString ¶
func (r *SentimentAnalysisResponse) ToJsonString() string
type SimilarWordsRequest ¶
type SimilarWordsRequest struct { *tchttp.BaseRequest // 输入的词语(仅支持UTF-8格式,不超过20字) Text *string `json:"Text,omitempty" name:"Text"` // 相似词个数;取值范围:1-200,默认为10; WordNumber *uint64 `json:"WordNumber,omitempty" name:"WordNumber"` }
func NewSimilarWordsRequest ¶
func NewSimilarWordsRequest() (request *SimilarWordsRequest)
func (*SimilarWordsRequest) FromJsonString ¶
func (r *SimilarWordsRequest) FromJsonString(s string) error
func (*SimilarWordsRequest) ToJsonString ¶
func (r *SimilarWordsRequest) ToJsonString() string
type SimilarWordsResponse ¶
type SimilarWordsResponse struct { *tchttp.BaseResponse Response *struct { // 相似词数组 SimilarWords []*string `json:"SimilarWords,omitempty" name:"SimilarWords" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewSimilarWordsResponse ¶
func NewSimilarWordsResponse() (response *SimilarWordsResponse)
func (*SimilarWordsResponse) FromJsonString ¶
func (r *SimilarWordsResponse) FromJsonString(s string) error
func (*SimilarWordsResponse) ToJsonString ¶
func (r *SimilarWordsResponse) ToJsonString() string
type TextApprovalRequest ¶
type TextApprovalRequest struct { *tchttp.BaseRequest // 待审核的文本(仅支持UTF-8格式,不超过2000字) Text *string `json:"Text,omitempty" name:"Text"` // 文本审核模式(默认取1值): // 1、全领域审核 Flag *uint64 `json:"Flag,omitempty" name:"Flag"` }
func NewTextApprovalRequest ¶
func NewTextApprovalRequest() (request *TextApprovalRequest)
func (*TextApprovalRequest) FromJsonString ¶
func (r *TextApprovalRequest) FromJsonString(s string) error
func (*TextApprovalRequest) ToJsonString ¶
func (r *TextApprovalRequest) ToJsonString() string
type TextApprovalResponse ¶
type TextApprovalResponse struct { *tchttp.BaseResponse Response *struct { // 文本审核输出结果 EvilTokens []*EvilToken `json:"EvilTokens,omitempty" name:"EvilTokens" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewTextApprovalResponse ¶
func NewTextApprovalResponse() (response *TextApprovalResponse)
func (*TextApprovalResponse) FromJsonString ¶
func (r *TextApprovalResponse) FromJsonString(s string) error
func (*TextApprovalResponse) ToJsonString ¶
func (r *TextApprovalResponse) ToJsonString() string
type TextClassificationRequest ¶
type TextClassificationRequest struct { *tchttp.BaseRequest // 待分类的文本(仅支持UTF-8格式,不超过2000字) Text *string `json:"Text,omitempty" name:"Text"` // 领域分类体系(默认取1值): // 1、通用领域 // 2、新闻领域 Flag *uint64 `json:"Flag,omitempty" name:"Flag"` }
func NewTextClassificationRequest ¶
func NewTextClassificationRequest() (request *TextClassificationRequest)
func (*TextClassificationRequest) FromJsonString ¶
func (r *TextClassificationRequest) FromJsonString(s string) error
func (*TextClassificationRequest) ToJsonString ¶
func (r *TextClassificationRequest) ToJsonString() string
type TextClassificationResponse ¶
type TextClassificationResponse struct { *tchttp.BaseResponse Response *struct { // 文本分类结果(文本分类映射表请参见附录) Classes []*ClassificationResult `json:"Classes,omitempty" name:"Classes" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewTextClassificationResponse ¶
func NewTextClassificationResponse() (response *TextClassificationResponse)
func (*TextClassificationResponse) FromJsonString ¶
func (r *TextClassificationResponse) FromJsonString(s string) error
func (*TextClassificationResponse) ToJsonString ¶
func (r *TextClassificationResponse) ToJsonString() string
type TextCorrectionRequest ¶
type TextCorrectionRequest struct { *tchttp.BaseRequest // 待纠错的文本(仅支持UTF-8格式,不超过2000字) Text *string `json:"Text,omitempty" name:"Text"` }
func NewTextCorrectionRequest ¶
func NewTextCorrectionRequest() (request *TextCorrectionRequest)
func (*TextCorrectionRequest) FromJsonString ¶
func (r *TextCorrectionRequest) FromJsonString(s string) error
func (*TextCorrectionRequest) ToJsonString ¶
func (r *TextCorrectionRequest) ToJsonString() string
type TextCorrectionResponse ¶
type TextCorrectionResponse struct { *tchttp.BaseResponse Response *struct { // 纠错详情 CCITokens []*CCIToken `json:"CCITokens,omitempty" name:"CCITokens" list` // 纠错后的文本 ResultText *string `json:"ResultText,omitempty" name:"ResultText"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewTextCorrectionResponse ¶
func NewTextCorrectionResponse() (response *TextCorrectionResponse)
func (*TextCorrectionResponse) FromJsonString ¶
func (r *TextCorrectionResponse) FromJsonString(s string) error
func (*TextCorrectionResponse) ToJsonString ¶
func (r *TextCorrectionResponse) ToJsonString() string
type WordEmbeddingRequest ¶
type WordEmbeddingRequest struct { *tchttp.BaseRequest // 输入的词语(仅支持UTF-8格式,不超过20字) Text *string `json:"Text,omitempty" name:"Text"` }
func NewWordEmbeddingRequest ¶
func NewWordEmbeddingRequest() (request *WordEmbeddingRequest)
func (*WordEmbeddingRequest) FromJsonString ¶
func (r *WordEmbeddingRequest) FromJsonString(s string) error
func (*WordEmbeddingRequest) ToJsonString ¶
func (r *WordEmbeddingRequest) ToJsonString() string
type WordEmbeddingResponse ¶
type WordEmbeddingResponse struct { *tchttp.BaseResponse Response *struct { // 词向量的维度 Dimension *uint64 `json:"Dimension,omitempty" name:"Dimension"` // 词向量数组 Vector []*float64 `json:"Vector,omitempty" name:"Vector" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewWordEmbeddingResponse ¶
func NewWordEmbeddingResponse() (response *WordEmbeddingResponse)
func (*WordEmbeddingResponse) FromJsonString ¶
func (r *WordEmbeddingResponse) FromJsonString(s string) error
func (*WordEmbeddingResponse) ToJsonString ¶
func (r *WordEmbeddingResponse) ToJsonString() string
type WordSimilarityRequest ¶
type WordSimilarityRequest struct { *tchttp.BaseRequest // 计算相似度的源词(仅支持UTF-8格式,不超过20字) SrcWord *string `json:"SrcWord,omitempty" name:"SrcWord"` // 计算相似度的目标词(仅支持UTF-8格式,不超过20字) TargetWord *string `json:"TargetWord,omitempty" name:"TargetWord"` }
func NewWordSimilarityRequest ¶
func NewWordSimilarityRequest() (request *WordSimilarityRequest)
func (*WordSimilarityRequest) FromJsonString ¶
func (r *WordSimilarityRequest) FromJsonString(s string) error
func (*WordSimilarityRequest) ToJsonString ¶
func (r *WordSimilarityRequest) ToJsonString() string
type WordSimilarityResponse ¶
type WordSimilarityResponse struct { *tchttp.BaseResponse Response *struct { // 两个词语的相似度 Similarity *float64 `json:"Similarity,omitempty" name:"Similarity"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewWordSimilarityResponse ¶
func NewWordSimilarityResponse() (response *WordSimilarityResponse)
func (*WordSimilarityResponse) FromJsonString ¶
func (r *WordSimilarityResponse) FromJsonString(s string) error
func (*WordSimilarityResponse) ToJsonString ¶
func (r *WordSimilarityResponse) ToJsonString() string