LoginSignup
13
22

More than 5 years have passed since last update.

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

Posted at

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("おはよう"))
13
22
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
22