Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
21
Help us understand the problem. What is going on with this article?

More than 3 years have passed since last update.

@mkimura81

機械学習API群A3RTをPythonから使う

A3RT
テキストの分類や自動生成、画像のスコアリング、対話などができるようです。

現在使うことのできるAPIは以下のようです。
* Text Suggest API
* Text Classification API
* Listing API
* Image Influence API
* Proofreading API
* Talk API

Pythonで使用する

使用するライブラリ: pya3rt
https://github.com/nocotan/pya3rt

インストール

$ pip install pya3rt

サンプル

Text Suggest

# -*- coding: utf-8 -*-
import pya3rt

apikey = "{YOUR_API_KEY}"
client = pya3rt.TextSuggestClient(apikey)

print(client.text_suggest("馬"))
print(client.text_suggest("あき", style=1))
print(client.text_suggest("func", style=2))

Text Classification

# -*- coding: utf-8 -*-
import pya3rt

apikey = "{YOUR_API_KEY}"
client = pya3rt.TextClassificationClient(apikey)

print(client.classify("システムの企画から開発・運用まで幅広く関われます。"))

Proofreading API

# -*- coding: utf-8 -*-
import pya3rt

apikey = "{YOUR_API_KEY}"
client = pya3rt.ProofreadingClient(apikey)

print(client.proofreading("システムの企画から開発・運用まで幅広く関われます。"))
print(client.proofreading("システムの規格から開発・運用まで幅広く関われます。"))

Image Influence API

# -*- coding: utf-8 -*-
import pya3rt

apikey = "{YOUR_API_KEY}"
client = pya3rt.ImageInfluenceClient(apikey)

print(client.get_upload_url())
print(client.meat_score("meat1.jpeg", 1))

Talk API

# -*- coding: utf-8 -*-
import pya3rt

apikey = "{YOUR_API_KEY}"
client = pya3rt.TalkClient(apikey)

print(client.talk("おはよう"))
21
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
21
Help us understand the problem. What is going on with this article?