class NaturalLanguageProcessing

Tencent AI 自然语言相关能力.

Traits

NLP

Constants

BASE_URL

SEG

POS

NER

SYN

COM

POLAR

CHAT

Methods

array
wordseg(string $text)

分词 GBK.

array
wordpos(string $text)

词性标注 GBK.

array
wordner(string $text)

专有名词识别 GBK.

array
wordsyn(string $text)

同义词识别 GBK.

array
wordcom(string $text)

语义解析 => 意图成分识别.

array
textPolar(string $text)

情感分析.

array
chat(string $question, string $session)

智能闲聊.

Details

at line 47
array wordseg(string $text)

分词 GBK.

对文本进行智能分词识别,支持基础词与混排词粒度

Parameters

string $text

Return Value

array

Exceptions

TencentAIException

See also

https://ai.qq.com/doc/nlpbase.shtml

at line 63
array wordpos(string $text)

词性标注 GBK.

在分词接口的基础上,增加词性标注能力,将分词结果中的每个分词赋予一个正确的词性,例如形容词、动名词或者名词等等

Parameters

string $text

Return Value

array

Exceptions

TencentAIException

at line 79
array wordner(string $text)

专有名词识别 GBK.

对文本进行专有名词的分词识别,找出文本中的专有名词

Parameters

string $text

Return Value

array

Exceptions

TencentAIException

at line 95
array wordsyn(string $text)

同义词识别 GBK.

识别文本中存在同义词的分词,并返回相应的同义词

Parameters

string $text

Return Value

array

Exceptions

TencentAIException

at line 113
array wordcom(string $text)

语义解析 => 意图成分识别.

对文本进行意图识别,快速找出意图及上下文成分.

Parameters

string $text

Return Value

array

Exceptions

TencentAIException

See also

https://ai.qq.com/doc/nlpsem.shtml

at line 131
array textPolar(string $text)

情感分析.

对文本进行情感分析,快速判断情感倾向(正面 1 或负面 -1 中性 0)

Parameters

string $text

Return Value

array

Exceptions

TencentAIException

See also

https://ai.qq.com/doc/nlpemo.shtml

at line 150
array chat(string $question, string $session)

智能闲聊.

基于文本的基础聊天能力,可以让您的应用快速拥有具备上下文语义理解的机器聊天功能.

Parameters

string $question 上限300字节
string $session 上限32字节

Return Value

array

Exceptions

TencentAIException

See also

https://ai.qq.com/doc/nlpchat.shtml