LoginSignup
3
4

More than 1 year has passed since last update.

ChatGPT の対抗馬 NotionAI にSwift書いてとお願いしてみた結果

Last updated at Posted at 2023-02-23

まず初めに、AIの技術が進歩してるのを数日前に取り入れてみたChatGPTにはまった1週間でしたが
パッと出てきた 広告に NotionAI が出てきた。

即、アカウントを作って、課金をして遊んでみた。

NotionAI
https://notion.so/

ChatGPTでSwiftのソースコード書いてくれるから便利だなって思ってたんですが
以下試してみた質問

Q.Swift言語で100×10の掛け算を行うサンプルコードを教えてください。

以下がSwift言語で100×10の掛け算を行うコードになります。

Sample
let result = 100 * 10
print(result)

実行すると、1000と表示されます。

という回答が、👏👏👏すごい!!って思って

試しに以下のようなほぼ仕様のようなものをお願いしてみました。

Q.少し長い以下の文章を質問しました

最初の画面(1つ目の画面)が1つ真ん中にSTARTボタンが表示されており、真ん中のボタンをタップすると、次の画面(2つめの画面)を表示します。
2つ目の画面には、AIで学ぶSwiftの内容の一覧をいくつか表示します。
さらに、ナビゲーションボタンの右上に設定ボタンがあり、その設定ボタンから設定画面が出ます。

回答

以下はサンプルコードです。最初の画面(1つ目の画面)が1つ真ん中にSTARTボタンが表示されており、真ん中のボタンをタップすると、次の画面(2つめの画面)を表示します。
2つ目の画面には、AIで学ぶSwiftの内容の一覧をいくつか表示します。
さらに、ナビゲーションボタンの右上に設定ボタンがあり、その設定ボタンから設定画面が出ます。

Sample2
import UIKit

class FirstViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .white

        let startButton = UIButton()
        startButton.setTitle("START", for: .normal)
        startButton.setTitleColor(.black, for: .normal)
        startButton.titleLabel?.font = UIFont.systemFont(ofSize: 30)
        startButton.addTarget(self, action: #selector(startButtonTapped), for: .touchUpInside)
        view.addSubview(startButton)
        startButton.translatesAutoresizingMaskIntoConstraints = false
        startButton.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
        startButton.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
    }

    @objc private func startButtonTapped() {
        let secondViewController = SecondViewController()
        navigationController?.pushViewController(secondViewController, animated: true)
    }
}

class SecondViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .white

        let titleLabel = UILabel()
        titleLabel.text = "AIで学ぶSwift"
        titleLabel.font = UIFont.boldSystemFont(ofSize: 30)
        view.addSubview(titleLabel)
        titleLabel.translatesAutoresizingMaskIntoConstraints = false
        titleLabel.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 50).isActive = true
        titleLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true

        let content1Label = UILabel()
        content1Label.text = "・Swiftの基礎"
        content1Label.font = UIFont.systemFont(ofSize: 20)
        view.addSubview(content1Label)
        content1Label.translatesAutoresizingMaskIntoConstraints = false
        content1Label.topAnchor.constraint(equalTo: titleLabel.bottomAnchor, constant: 50).isActive = true
        content1Label.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 30).isActive = true

        let content2Label = UILabel()
        content2Label.text = "・Swiftでのプログラミング"
        content2Label.font = UIFont.systemFont(ofSize: 20)
        view.addSubview(content2Label)
        content2Label.translatesAutoresizingMaskIntoConstraints = false
        content2Label.topAnchor.constraint(equalTo: content1Label.bottomAnchor, constant: 20).isActive = true
        content2Label.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 30).isActive = true

        let content3Label = UILabel()
        content3Label.text = "・AIとSwift"
        content3Label.font = UIFont.systemFont(ofSize: 20)
        view.addSubview(content3Label)
        content3Label.translatesAutoresizingMaskIntoConstraints = false
        content3Label.topAnchor.constraint(equalTo: content2Label.bottomAnchor, constant: 20).isActive = true
        content3Label.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 30).isActive = true
    }
}

class SettingsViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .white

        let titleLabel = UILabel()
        titleLabel.text = "設定"
        titleLabel.font = UIFont.boldSystemFont(ofSize: 30)
        view.addSubview(titleLabel)
        titleLabel.translatesAutoresizingMaskIntoConstraints = false
        titleLabel.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 50).isActive = true
        titleLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
    }
}

class TabBarController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let firstViewController = FirstViewController()
        let secondViewController = SecondViewController()
        let settingsViewController = SettingsViewController()

        firstViewController.tabBarItem = UITabBarItem(title: "Start", image: nil, tag: 0)
        secondViewController.tabBarItem = UITabBarItem(title: "AI+Swift", image: nil, tag: 1)
        settingsViewController.tabBarItem = UITabBarItem(title: "Settings", image: nil, tag: 2)

        let navigationController = UINavigationController(rootViewController: firstViewController)
        let secondNavigationController = UINavigationController(rootViewController: secondViewController)
        let settingsNavigationController = UINavigationController(rootViewController: settingsViewController)

        viewControllers = [navigationController, secondNavigationController, settingsNavigationController]
    }
}

let tabBarController = TabBarController()
tabBarController.selectedIndex = 0
tabBarController.viewControllers?[0].navigationController?.setNavigationBarHidden(true, animated: false)

すごくない?!やばいですよね!!!!

これ数秒でレスポンスが返ってきました。

これは、、、思わず、クレジットカードを出してポチッとしてしまいました。

ChatGPTについて

ChatGPT
https://chat.openai.com/

 Chat GPTは、OpenAIが開発した自然言語処理のための大規模なニューラルネットワークの一種で、人工知能の分野で最先端の技術の一つです。Chat GPTは、大量のテキストデータを学習して、人間が書いたような自然な文章を生成することができます。これにより、様々な自然言語処理タスクにおいて、高い精度を発揮しています。

OpenAIについて

OpenAI
https://openai.com/

 OpenAIは、人工知能技術の研究や開発を行う非営利団体で、2015年に設立されました。OpenAIは、人工知能がもたらす社会的影響や倫理的問題にも関心を持ち、透明性や公正性を重視した研究や開発を行っています。OpenAIは、人工知能技術を活用して、自然言語処理、画像処理、音声処理などの分野で最先端の技術を開発しています。

 OpenAIの代表的な成果の一つには、GPT(Generative Pre-trained Transformer)があります。GPTは、Chat GPTのベースとなった技術で、大量のテキストデータを学習して、自然言語生成タスクにおいて高い精度を発揮することができます。また、OpenAIは、画像生成や画像認識においても、最先端の技術を開発しています。

 OpenAIは、人工知能技術の発展において大きな役割を果たしており、今後もさらなる研究や開発が期待されています。

Notionについて

Notion
https://notion.so/

 Notion(ノーション)は、個人やチーム向けのオールインワン型のプロダクティビティツールです。Notionを利用することで、タスク管理、プロジェクト管理、ノート取り、ドキュメント作成、カレンダー管理など、様々な業務を1つのアプリケーションで完結させることができます。

 Notionは、直感的なドラッグ&ドロップのインターフェースや、豊富なブロック機能が特徴的です。ブロック機能を活用することで、ノートやドキュメントにはテキストだけでなく、画像、動画、表、カレンダー、To Doリストなど様々な形式の情報を追加することができます。

 また、NotionAIという機能もあり、これは人工知能を活用して、ユーザーが入力した情報を整理したり、自動的にスケジュールを作成したり、類似した情報を自動的にグループ化したりすることができます。これにより、業務の効率化や時間の節約につながるとされています。

まとめ

AIを活用したサービスが増えることにより、より多くの人々が業務の効率化や生活の向上を実現できる可能性が高まっています。Notionのようなプロダクティビティツールも、AI技術を活用することで、より使いやすく、効率的なツールに進化していくかもしれません。


関連記事

サンストライプについて - About


制作チーム:サンストライプ

sunstripe_logo.png
http://sunstripe.main.jp/
サンストライプについて
制作チームのサンストライプのコンテンツについては以下の通り

月3回のコンテンツをリリースしています。
参加者は、プログラマーやデザイナー、イラストレーター、声優やVTuberなどが募集中です。

関連プロジェクト・支援団体

その他協力応援 / 支援者の集い

3
4
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
3
4