 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- Variables
- func UnmarshalResultInto(data []byte, result interface{}) error
- type CharResult
- type EnCorrectResultItem
- type ErrorResult
- type KeyPhraseExtractionParam
- type KeyPhraseExtractionResult
- type KeywordItem
- type Nlp
- func (c *Nlp) GetKeyPhraseExtractionExtract(param *KeyPhraseExtractionParam) (*KeyPhraseExtractionResult, error)
- func (c *Nlp) GetSentimentAnalysis(param *SentimentAnalysisParam) (*SentimentAnalysisResult, error)
- func (c *Nlp) GetTextCorrectionEnCorrect(param *TextCorrectionEnCorrectParam) (*TextCorrectionEnCorrectResult, error)
- func (c *Nlp) GetTextCorrectionZhCorrect(param *TextCorrectionZhCorrectParam) (*TextCorrectionZhCorrectResult, error)
- func (c *Nlp) GetTextSummarization(param *TextSummarizationParam) (*TextSummarizationResult, error)
- func (c *Nlp) NlpPost(action string, query url.Values, req, result interface{}) error
 
- type SentimentAnalysisParam
- type SentimentAnalysisResult
- type TextCorrectionEnCorrectParam
- type TextCorrectionEnCorrectResult
- type TextCorrectionZhCorrectParam
- type TextCorrectionZhCorrectResult
- type TextSummarizationParam
- type TextSummarizationResult
- type WordResult
Constants ¶
      View Source
      
  
const ( ServiceName = "nlp_gateway" ApiVersion1 = "2020-09-01" ApiVersion2 = "2020-12-01" DefaultTimeout = 10 * time.Second )
Variables ¶
      View Source
      
  
    var ( ServiceInfoMap = map[string]*base.ServiceInfo{ base.RegionCnNorth1: { Timeout: 10 * time.Second, Scheme: "https", Host: "open.volcengineapi.com", Header: http.Header{ "Accept": []string{"application/json"}, }, Credentials: base.Credentials{ Region: base.RegionCnNorth1, Service: ServiceName, }, }, } ApiInfoList = map[string]*base.ApiInfo{ "TextCorrectionZhCorrect": { Method: http.MethodPost, Path: "/", Query: url.Values{ "Action": []string{"TextCorrectionZhCorrect"}, "Version": []string{ApiVersion1}, }, }, "TextCorrectionEnCorrect": { Method: http.MethodPost, Path: "/", Query: url.Values{ "Action": []string{"TextCorrectionEnCorrect"}, "Version": []string{ApiVersion1}, }, }, "SentimentAnalysis": { Method: http.MethodPost, Path: "/", Query: url.Values{ "Action": []string{"SentimentAnalysis"}, "Version": []string{ApiVersion2}, }, }, "TextSummarization": { Method: http.MethodPost, Path: "/", Query: url.Values{ "Action": []string{"TextSummarization"}, "Version": []string{ApiVersion2}, }, }, "KeyphraseExtractionExtract": { Method: http.MethodPost, Path: "/", Query: url.Values{ "Action": []string{"KeyphraseExtractionExtract"}, "Version": []string{ApiVersion1}, }, }, } )
      View Source
      
  var DefaultInstance = NewInstance()
    DefaultInstance 默认实例,Region: cn-north-1
Functions ¶
func UnmarshalResultInto ¶
Types ¶
type CharResult ¶
type EnCorrectResultItem ¶
type ErrorResult ¶
type ErrorResult struct {
	Message string `json:"message"`
}
    type KeyPhraseExtractionResult ¶
type KeyPhraseExtractionResult struct {
	Keywords []KeywordItem `json:"keywords"`
}
    type KeywordItem ¶
type Nlp ¶
func NewInstance ¶
func NewInstance() *Nlp
func (*Nlp) GetKeyPhraseExtractionExtract ¶
func (c *Nlp) GetKeyPhraseExtractionExtract(param *KeyPhraseExtractionParam) (*KeyPhraseExtractionResult, error)
关键词提取
func (*Nlp) GetSentimentAnalysis ¶
func (c *Nlp) GetSentimentAnalysis(param *SentimentAnalysisParam) (*SentimentAnalysisResult, error)
情感分析
func (*Nlp) GetTextCorrectionEnCorrect ¶
func (c *Nlp) GetTextCorrectionEnCorrect(param *TextCorrectionEnCorrectParam) (*TextCorrectionEnCorrectResult, error)
英文文本纠错
func (*Nlp) GetTextCorrectionZhCorrect ¶
func (c *Nlp) GetTextCorrectionZhCorrect(param *TextCorrectionZhCorrectParam) (*TextCorrectionZhCorrectResult, error)
中文文本纠错
func (*Nlp) GetTextSummarization ¶
func (c *Nlp) GetTextSummarization(param *TextSummarizationParam) (*TextSummarizationResult, error)
文本摘要
type SentimentAnalysisParam ¶
type SentimentAnalysisParam struct {
	Text string `json:"text"`
}
    type SentimentAnalysisResult ¶
type TextCorrectionEnCorrectParam ¶
type TextCorrectionEnCorrectParam struct {
	Content string `json:"content"`
}
    type TextCorrectionEnCorrectResult ¶
type TextCorrectionEnCorrectResult struct {
	Result []EnCorrectResultItem `json:"result"`
}
    type TextCorrectionZhCorrectParam ¶
type TextCorrectionZhCorrectParam struct {
	Content string `json:"content"`
}
    type TextCorrectionZhCorrectResult ¶
type TextCorrectionZhCorrectResult struct {
	CharResult []CharResult `json:"char_result"`
	WordResult []WordResult `json:"word_result"`
}
    type TextSummarizationParam ¶
type TextSummarizationParam struct {
	Text string `json:"text"`
}
    type TextSummarizationResult ¶
type TextSummarizationResult struct {
	Result string `json:"result"`
}
     Click to show internal directories. 
   Click to hide internal directories.