Skip to main content

A Python library for the ClueAI API

Project description




CLUEAI logo: The data structure for unstructured data


使NLP成为每个开发者的工具

PyPI

*Read this in other languages: English

Python 软件包

该软件包提供了开发的功能,以简化在python3中与clueai API的接口。

安装

可以使用 pip命令安装:

pip install --upgrade clueai

也可以通过源码:

python setup.py install

快速开始

免费试玩

分类任务 🔐
import clueai
from clueai.classify import Example
# initialize the Clueai Client with an API Key
cl = clueai.Client("", check_api_key=False)
response = cl.classify(model_name='clueai-base',
  task_name='情感分析',
  inputs=["世界充满了欺骗", "世界和平"],
  examples=[Example("基本都是欺骗", "消极"),
   Example("基本都是惊喜", "积极")],
  labels = ["消极", "积极"])
  
print('prediction: {}'.format(
       response.classifications))

更大模型更好效果

在用更大模型之前,你需要有个API key, 并且在创建clueai.Client对象时需要指定这个API key. API key 可以通过这个平台获得,下面是有关分类和生成任务的一个基本的示例

分类任务 🔐
import clueai
from clueai.classify import Example
# initialize the Clueai Client with an API Key
cl = clueai.Client('YOUR_API_KEY')
response = cl.classify(model_name='clueai-large',
  task_name='情感分析',
  inputs=["世界充满了欺骗", "世界和平"],
  examples=[Example("基本都是欺骗", "消极"),
   Example("基本都是惊喜", "积极")],
  labels = ["消极", "积极"])
  
print('prediction: {}'.format(
       response.classifications))

模型介绍

当您调用clueai的API时,我们为您的用例指定默认模型。 默认模型非常适合您开始使用,但是在生产环境中,我们建议您通过model_name参数自己指定特定模型。

返回结果

对于不同的任务返回相对应的clueai对象(例如,对于分类,将是“Classification”)。

ClueAI 被Clue AI 支持,并且相关协议可以查看licensed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clueai-0.0.0.2.tar.gz (7.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page