Documentation
¶
Index ¶
- Constants
- type AutoSummarizationRequest
- type AutoSummarizationResponse
- type CCIToken
- type ChatBotRequest
- type ChatBotResponse
- type ClassificationResult
- type Client
- func (c *Client) AutoSummarization(request *AutoSummarizationRequest) (response *AutoSummarizationResponse, err error)
- func (c *Client) ChatBot(request *ChatBotRequest) (response *ChatBotResponse, err error)
- func (c *Client) DependencyParsing(request *DependencyParsingRequest) (response *DependencyParsingResponse, err error)
- func (c *Client) DescribeEntity(request *DescribeEntityRequest) (response *DescribeEntityResponse, err error)
- func (c *Client) DescribeRelation(request *DescribeRelationRequest) (response *DescribeRelationResponse, err error)
- func (c *Client) DescribeTriple(request *DescribeTripleRequest) (response *DescribeTripleResponse, 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) 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) 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 DependencyParsingRequest
- type DependencyParsingResponse
- type DescribeEntityRequest
- type DescribeEntityResponse
- type DescribeRelationRequest
- type DescribeRelationResponse
- type DescribeTripleRequest
- type DescribeTripleResponse
- type DpToken
- type EntityRelationContent
- type EntityRelationObject
- type EntityRelationSubject
- type Keyword
- type KeywordsExtractionRequest
- type KeywordsExtractionResponse
- type LexicalAnalysisRequest
- type LexicalAnalysisResponse
- type NerToken
- type PosToken
- type SentenceEmbeddingRequest
- type SentenceEmbeddingResponse
- type SentenceSimilarityRequest
- type SentenceSimilarityResponse
- type SentimentAnalysisRequest
- type SentimentAnalysisResponse
- type SimilarWordsRequest
- type SimilarWordsResponse
- type TextClassificationRequest
- type TextClassificationResponse
- type TextCorrectionRequest
- type TextCorrectionResponse
- type TripleContent
- 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 ChatBotRequest ¶
type ChatBotRequest struct {
*tchttp.BaseRequest
// 用户请求的query
Query *string `json:"Query,omitempty" name:"Query"`
// 0: 通用闲聊, 1:儿童闲聊, 默认是通用闲聊
Flag *uint64 `json:"Flag,omitempty" name:"Flag"`
// 服务的id, 主要用于儿童闲聊接口,比如手Q的openid
OpenId *string `json:"OpenId,omitempty" name:"OpenId"`
}
func NewChatBotRequest ¶
func NewChatBotRequest() (request *ChatBotRequest)
func (*ChatBotRequest) FromJsonString ¶
func (r *ChatBotRequest) FromJsonString(s string) error
func (*ChatBotRequest) ToJsonString ¶
func (r *ChatBotRequest) ToJsonString() string
type ChatBotResponse ¶
type ChatBotResponse struct {
*tchttp.BaseResponse
Response *struct {
// 对于当前输出回复的自信度
Confidence *float64 `json:"Confidence,omitempty" name:"Confidence"`
// 闲聊回复
Reply *string `json:"Reply,omitempty" name:"Reply"`
// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
} `json:"Response"`
}
func NewChatBotResponse ¶
func NewChatBotResponse() (response *ChatBotResponse)
func (*ChatBotResponse) FromJsonString ¶
func (r *ChatBotResponse) FromJsonString(s string) error
func (*ChatBotResponse) ToJsonString ¶
func (r *ChatBotResponse) 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) ChatBot ¶
func (c *Client) ChatBot(request *ChatBotRequest) (response *ChatBotResponse, err error)
闲聊服务基于腾讯领先的NLP引擎能力、数据运算能力和千亿级互联网语料数据的支持,同时集成了广泛的知识问答能力,可实现上百种自定义属性配置,以及儿童语言风格及说话方式,从而让聊天变得更睿智、简单和有趣。
func (*Client) DependencyParsing ¶
func (c *Client) DependencyParsing(request *DependencyParsingRequest) (response *DependencyParsingResponse, err error)
句法依存分析接口能够分析出句子中词与词之间的相互依存关系,并揭示其句法结构,包括主谓关系、动宾关系、核心关系等等,可用于提取句子主干、提取句子核心词等,在机器翻译、自动问答、知识抽取等领域都有很好的应用。
func (*Client) DescribeEntity ¶
func (c *Client) DescribeEntity(request *DescribeEntityRequest) (response *DescribeEntityResponse, err error)
输入实体名称,返回实体相关的信息如实体别名、实体英文名、实体详细信息、相关实体等。
func (*Client) DescribeRelation ¶
func (c *Client) DescribeRelation(request *DescribeRelationRequest) (response *DescribeRelationResponse, err error)
输入两个实体,返回两个实体间的关系,例如马化腾与腾讯公司不仅是相关实体,二者还存在隶属关系(马化腾属于腾讯公司)。
func (*Client) DescribeTriple ¶
func (c *Client) DescribeTriple(request *DescribeTripleRequest) (response *DescribeTripleResponse, err error)
三元组查询,主要分为两类,SP查询和PO查询。SP查询表示已知主语和谓语查询宾语,PO查询表示已知宾语和谓语查询主语。每一个SP或PO查询都是一个可独立执行的查询,TQL支持SP查询的嵌套查询,即主语可以是一个嵌套的子查询。其他复杂的三元组查询方法,请参考官网API文档示例。
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) 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) TextClassification ¶
func (c *Client) TextClassification(request *TextClassificationRequest) (response *TextClassificationResponse, err error)
文本分类接口能够对用户输入的文本进行自动分类,将其映射到具体的类目上,用户只需要提供待分类的文本,而无需关注具体实现。
该功能基于基于千亿级大规模互联网语料和LSTM、BERT等深度神经网络模型进行训练,并持续迭代更新,以保证效果不断提升。
目前已提供:
- 通用领域分类体系,包括15个分类类目,分别是汽车、科技、健康、体育、旅行、教育、职业、文化、军事、房产、娱乐、女性、奥运、财经以及其他,适用于通用的场景。
- 新闻领域分类体系,包括37个一级分类类目,285个二级分类(详细请见 [类目体系映射表](https://cloud.tencent.com/document/product/271/36459)),已应用于腾讯新闻的文章分类。
更多垂直领域的分类体系即将推出,敬请期待。
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 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 {
// 句法依存分析结果,其中句法依存关系的类型包括:
// <li>主谓关系,eg: 我送她一束花 (我 <-- 送)
// <li>动宾关系,eg: 我送她一束花 (送 --> 花)
// <li>间宾关系,eg: 我送她一束花 (送 --> 她)
// <li>前置宾语,eg: 他什么书都读 (书 <-- 读)
// <li>兼语,eg: 他请我吃饭 (请 --> 我)
// <li>定中关系,eg: 红苹果 (红 <-- 苹果)
// <li>状中结构,eg: 非常美丽 (非常 <-- 美丽)
// <li>动补结构,eg: 做完了作业 (做 --> 完)
// <li>并列关系,eg: 大山和大海 (大山 --> 大海)
// <li>介宾关系,eg: 在贸易区内 (在 --> 内)
// <li>左附加关系,eg: 大山和大海 (和 <-- 大海)
// <li>右附加关系,eg: 孩子们 (孩子 --> 们)
// <li>独立结构,eg: 两个单句在结构上彼此独立
// <li>标点符号,eg: 。
// <li>核心关系,eg: 整个句子的核心
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 DescribeEntityRequest ¶
type DescribeEntityRequest struct {
*tchttp.BaseRequest
// 实体名称
EntityName *string `json:"EntityName,omitempty" name:"EntityName"`
}
func NewDescribeEntityRequest ¶
func NewDescribeEntityRequest() (request *DescribeEntityRequest)
func (*DescribeEntityRequest) FromJsonString ¶
func (r *DescribeEntityRequest) FromJsonString(s string) error
func (*DescribeEntityRequest) ToJsonString ¶
func (r *DescribeEntityRequest) ToJsonString() string
type DescribeEntityResponse ¶
type DescribeEntityResponse struct {
*tchttp.BaseResponse
Response *struct {
// 返回查询实体相关信息
Content *string `json:"Content,omitempty" name:"Content"`
// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
} `json:"Response"`
}
func NewDescribeEntityResponse ¶
func NewDescribeEntityResponse() (response *DescribeEntityResponse)
func (*DescribeEntityResponse) FromJsonString ¶
func (r *DescribeEntityResponse) FromJsonString(s string) error
func (*DescribeEntityResponse) ToJsonString ¶
func (r *DescribeEntityResponse) ToJsonString() string
type DescribeRelationRequest ¶
type DescribeRelationRequest struct {
*tchttp.BaseRequest
// 输入第一个实体
LeftEntityName *string `json:"LeftEntityName,omitempty" name:"LeftEntityName"`
// 输入第二个实体
RightEntityName *string `json:"RightEntityName,omitempty" name:"RightEntityName"`
}
func NewDescribeRelationRequest ¶
func NewDescribeRelationRequest() (request *DescribeRelationRequest)
func (*DescribeRelationRequest) FromJsonString ¶
func (r *DescribeRelationRequest) FromJsonString(s string) error
func (*DescribeRelationRequest) ToJsonString ¶
func (r *DescribeRelationRequest) ToJsonString() string
type DescribeRelationResponse ¶
type DescribeRelationResponse struct {
*tchttp.BaseResponse
Response *struct {
// 返回查询实体间的关系
Content []*EntityRelationContent `json:"Content,omitempty" name:"Content" list`
// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
} `json:"Response"`
}
func NewDescribeRelationResponse ¶
func NewDescribeRelationResponse() (response *DescribeRelationResponse)
func (*DescribeRelationResponse) FromJsonString ¶
func (r *DescribeRelationResponse) FromJsonString(s string) error
func (*DescribeRelationResponse) ToJsonString ¶
func (r *DescribeRelationResponse) ToJsonString() string
type DescribeTripleRequest ¶
type DescribeTripleRequest struct {
*tchttp.BaseRequest
// 三元组查询条件
TripleCondition *string `json:"TripleCondition,omitempty" name:"TripleCondition"`
}
func NewDescribeTripleRequest ¶
func NewDescribeTripleRequest() (request *DescribeTripleRequest)
func (*DescribeTripleRequest) FromJsonString ¶
func (r *DescribeTripleRequest) FromJsonString(s string) error
func (*DescribeTripleRequest) ToJsonString ¶
func (r *DescribeTripleRequest) ToJsonString() string
type DescribeTripleResponse ¶
type DescribeTripleResponse struct {
*tchttp.BaseResponse
Response *struct {
// 返回三元组信息
Content []*TripleContent `json:"Content,omitempty" name:"Content" list`
// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
} `json:"Response"`
}
func NewDescribeTripleResponse ¶
func NewDescribeTripleResponse() (response *DescribeTripleResponse)
func (*DescribeTripleResponse) FromJsonString ¶
func (r *DescribeTripleResponse) FromJsonString(s string) error
func (*DescribeTripleResponse) ToJsonString ¶
func (r *DescribeTripleResponse) ToJsonString() string
type EntityRelationContent ¶
type EntityRelationContent struct {
// 实体关系查询返回关系的object
Object []*EntityRelationObject `json:"Object,omitempty" name:"Object" list`
// 实体关系查询返回关系的subject
Subject []*EntityRelationSubject `json:"Subject,omitempty" name:"Subject" list`
// 实体关系查询返回的关系名称
Relation *string `json:"Relation,omitempty" name:"Relation"`
}
type EntityRelationObject ¶
type EntityRelationSubject ¶
type KeywordsExtractionRequest ¶
type KeywordsExtractionRequest struct {
*tchttp.BaseRequest
// 待处理的文本(仅支持UTF-8格式,不超过10000字)
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"`
// 词法分析模式(默认取2值):
// 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 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、社交类
// 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 TextClassificationRequest ¶
type TextClassificationRequest struct {
*tchttp.BaseRequest
// 待分类的文本(仅支持UTF-8格式,不超过10000字)
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 TripleContent ¶
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