用于indico的python包装器。使用预先构建的最先进的机器学习算法和一行代码。

IndicoIo的Python项目详细描述


indico API的包装。

Indico API是免费使用的,不需要任何培训数据。

安装

来自PYPI:

pip install indicoio

来源:

git clone https://github.com/IndicoDataSolutions/IndicoIo-python.git
python setup.py install

API键+设置

对于api密钥注册和设置,请签出我们的quickstart guide

完整文档

详细的文档和进一步的代码示例可在 indico.io/docs

支持的API:

  • 积极/消极情绪分析
  • 政治情绪分析
  • 图像特征提取
  • 面部情绪识别
  • 面部特征提取
  • 语言检测
  • 文本主题标记

示例

>>>fromindicoioimportpolitical,sentiment,language,text_tags,keywords,fer,facial_features,image_features>>>indicoio.config.api_key="YOUR_API_KEY">>>political("Guns don't kill people. People kill people."){u'Libertarian':0.47740164630834825,u'Green':0.08454409540443657,u'Liberal':0.16617097211030055,u'Conservative':0.2718832861769146}>>>sentiment('Worst movie ever.')0.07062467665597527>>>sentiment('Really enjoyed the movie.')0.8105182526856075>>>text_tags("Facebook blog posts about Android tech make better journalism than most news outlets.")>>>text_tags(test_text,threshold=0.1)# return only keys with value > 0.1{u'startups_and_entrepreneurship':0.21888586688354486}>>>text_tags(test_text,top_n=1)# return only keys with top_n values{u'startups_and_entrepreneurship':0.21888586688354486}>>>importnumpyasnp>>>test_face=np.linspace(0,50,48*48).reshape(48,48)>>>fer(test_face){u'Angry':0.08843749137458341,u'Sad':0.39091163159204684,u'Neutral':0.1947947999669361,u'Surprise':0.03443785859010413,u'Fear':0.17574534848440568,u'Happy':0.11567286999192382}>>>facial_features(test_face)[0.0,-0.02568680526917187,0.21645604230056517,...,3.0342637531932777]>>>language('Quis custodiet ipsos custodes'){u'Swedish':0.00033330636691921914,u'Lithuanian':0.007328693814717631,u'Vietnamese':0.0002686116137658802,u'Romanian':8.133913804076592e-06,...}>>>keywords("Facebook blog posts about Android tech make better journalism than most news outlets.",top_n=3){u'android':0.10602030910588661,u'journalism':0.13466866170166855,u'outlets':0.13930405357808642}

批处理API

每个indicoio函数都可以用一个 请求。只需传入输入列表并接收结果列表 作为回报。

>>>fromindicoioimportsentiment>>>sentiment(['Best day ever','Worst day ever'])[0.9899001220871786,0.005709885173415242]

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java调用Python函数作为TEID中的UDF   java Android。支持v4导入不工作   java如何影响具有静态属性的类   java如何在从glTexImage2D()分配后编辑纹理的像素颜色   javaspringboot+rediscache+@Cacheable适用于某些方法,而不适用于其他方法   java无法将动态Web模块方面从3.0更改为2.5   java如何在新选项卡中显示打印的文档?   java Google Cloud Endpoints API方法仅在删除用户参数时成功调用   java为什么我可以使用Stack<Double>但不能使用Stack<Double>?   java JDBC PreparedStatement似乎忽略了占位符   java如何设置JInternalFrame的标准图标化位置?   Java文件。copy()不复制文件   基于另一个类的java显示arraylist?   java Android Studio:错误:非法字符:'\u2028'   对象(Java)无法实例化类型映像?   javascript错误:飞行前响应的HTTP状态代码401无效   java确保泛型vararg参数具有相同的类型