一:自然语言处理
# -*- coding: utf-8 -*-
# @Author : FELIX
# @Date : 2018/5/18 9:47
# pip install baidu-aip
from aip import AipNlp
""" 你的 APPID AK SK 从百度开发者平台申请 """
APP_ID = ''
API_KEY = ''
SECRET_KEY = ''
client = AipNlp(APP_ID, API_KEY, SECRET_KEY)
text='百度是一家高科技公司'
print(client.lexer(text))
text = "今天天气怎么样?"
""" 调用依存句法分析 """
print(client.depParser(text))
""" 如果有可选参数 """
options = {}
options["mode"] = 1
""" 带参数调用依存句法分析 """
print(client.depParser(text, options))
word = "张飞"
""" 调用词向量表示 """
print(client.wordEmbedding(word))
text = "床前明月光"
""" 调用DNN语言模型 """
print(client.dnnlm(text))
word1 = "北京"
word2 = "上海"
""" 调用词义相似度 """
p