今回はOpenAIの自然言語モデルGPT-4を使って、GitHubのREADME.mdを作成する方法を解説します。
GitHubで公開するプロジェクトを作成した際、README.mdを書き慣れていない人にとっては結構大変な作業かと思います。GPT-4を利用することでプロジェクトの簡単な概略を渡すだけでREADME.mdを自動生成してもらうことができますので、ぜひ試してみてください。
また、当ブログ内のChatGPTについての記事を以下のページでまとめていますので、あわせてご覧ください。

ChatGPTとは
ChatGPTは、OpenAIが提供する自然言語生成モデルです。GPT(Generative Pre-training Transformer)と呼ばれるモデルのアーキテクチャを採用しています。
GPTは、Transformerと呼ばれるニューラルネットワークを使用して、文書や言語処理タスクでのテキスト生成を行うモデルです。GPTは、大量のテキストデータを学習し、そのデータをもとに新しい文章を生成することができます。
ChatGPTは、GPTをもとにしたモデルであり、対話型システムやチャットボットなどで使われることを想定して開発されています。対話を続けることができるようになっており、ユーザーが入力するテキストに対して、自然で返答ができるようになっています。
利用するモデル GPT-4
今回使用するOpenAIの自然言語モデルGPT-4は、2023年3月現在、ChatGPT Plusに加入している方のみが使用できるようになっています。
ChatGPT Plusの加入方法は以下の記事で解説していますので、あわせてご覧ください。


README.mdのテンプレート
まずはGPT-4にどのような形式でREADME.mdを生成してもらうかを示すテンプレートを用意します。
今回は以下のようなテンプレートを用意しました。
# Project Name
A brief description of the project (overview)
[](https://opensource.org/licenses/MIT)
## Table of Contents
- [Overview](#overview)
- [Getting Started](#getting-started)
- [Installation](#installation)
- [Usage](#usage)
- [Screenshots](#screenshots)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)
## Overview
This project is (provide a detailed explanation or purpose)
## Getting Started
In this section, explain the project's requirements and how to set up the development environment.
### Prerequisites
- List required environments, libraries, or dependencies
- Example: Node.js v14 or higher
- Example: Python 3.7 or higher
## Installation
1. Clone or download the repository.
git clone https://github.com/username/repository.git
2. Install the required libraries or modules.
command example
## Usage
Explain how to use the project. Provide detailed code examples and execution methods.
execution command example
## Screenshots
Include screenshots or demo videos of the project here.

## Contributing
Explain how other developers can contribute to the project, such as reporting issues or creating pull requests.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Contact
For questions or bug reports, please use the following methods:
- GitHub Issues: https://github.com/username/repository/issues
- Email: example@example.com

ChatGPT(GPT-4)へ入力するプロンプト
続いてChatGPT に指示をするためのプロンプトを用意します。
今回は私が公開している以下のGitHubのリポジトリを例に紹介します。
プロンプトの要素
今回はGPT-4への指示として以下の情報を用意しました。
- 対象となるプロジェクトの概要
- 対象となるプロジェクトのソースコード
- 作成するREADME.mdファイルのフォーマット
作成したプロンプト
こちらが実際にGPT-4に読み込むプロンプトです。
README.mdのフォーマットは、前項で紹介したものをそのまま貼り付けています。
GitHubで公開するプロジェクトのREADME.mdファイルを作成してください。
・対象となるプロジェクトの概要
本プロジェクトは、クラウドコンピューティングサービス、Paperspaceの仮想マシン上で実行されることを想定しています。
画像生成AIであるStable DiffusionのWebUIである、AUTOMATIC1111をインストールから起動までを行うスクリプトです。
初心者の方でも扱えるよう、必要最小限のコードのみを実装しています。
ライセンス形態についてはMIT Licenseとします。
・対象となるプロジェクトのソースコード
対象となるプロジェクトのソースコードは以下のJupyter Notebookで作成されたコードです。
https://github.com/Murasan201/paperspace-automatic1111/blob/main/murasanlab-paperspace-automatic1111v1.ipynb
このコードを解説するREADME.mdを作成してください。
・作成するREADME.mdファイルのフォーマット
出力するREADME.mdファイルは以下のフォーマットに従い作成してください。
# Project Name
A brief description of the project (overview)
[](https://opensource.org/licenses/MIT)
## Table of Contents
- [Overview](#overview)
- [Getting Started](#getting-started)
- [Installation](#installation)
- [Usage](#usage)
- [Screenshots](#screenshots)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)
## Overview
This project is (provide a detailed explanation or purpose)
## Getting Started
In this section, explain the project's requirements and how to set up the development environment.
### Prerequisites
- List required environments, libraries, or dependencies
- Example: Node.js v14 or higher
- Example: Python 3.7 or higher
## Installation
1. Clone or download the repository.
git clone https://github.com/username/repository.git
2. Install the required libraries or modules.
command example
## Usage
Explain how to use the project. Provide detailed code examples and execution methods.
execution command example
## Screenshots
Include screenshots or demo videos of the project here.

## Contributing
Explain how other developers can contribute to the project, such as reporting issues or creating pull requests.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Contact
For questions or bug reports, please use the following methods:
- GitHub Issues: https://github.com/username/repository/issues
- Email: example@example.com
実行結果
それでは実際にGPT-4にREADME.mdを作成してもらいます。
プロンプトを入力して実行する
ChatGPTの画面を開き、モデルをGPT-4に設定します。
そして先ほど作成したプロンプトを入力して送信ボタンをクリックします。

すると、以下のようにREADME.mdの内容が生成されました。

追加のプロンプト
しかしこのままでは使えませんので、マークダウン形式のコードを出してもらうように追加のプロンプトを送信します。
この内容をmarkdownのコードで再度出力してください
すると以下のようにマークダウンのコードが生成されました。

最終的な出力コード
こちらが最終的に出力されたREADME.mdのコードです。
bashのハイライト部分だけはうまく出力できなかったので手直ししましたが、それ以外は修正していません。
# Paperspace Automatic1111
A simple script to set up and run AUTOMATIC1111, a WebUI for Stable Diffusion image generation AI, on a Paperspace virtual machine.
[](https://opensource.org/licenses/MIT)
## Table of Contents
- [Overview](#overview)
- [Getting Started](#getting-started)
- [Installation](#installation)
- [Usage](#usage)
- [Screenshots](#screenshots)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)
## Overview
This project provides a simple script to set up and run AUTOMATIC1111, a WebUI for the Stable Diffusion image generation AI, on a Paperspace virtual machine. The script is designed for beginners and contains only the essential code needed for installation and execution.
## Getting Started
To use this project, you will need a Paperspace virtual machine and the Jupyter Notebook provided in the repository.
### Prerequisites
- A Paperspace virtual machine
- Jupyter Notebook
## Installation
1. Clone or download the repository.
```bash
git clone https://github.com/Murasan201/paperspace-automatic1111.git
```
2. Open the Jupyter Notebook in your Paperspace virtual machine.
```bash
murasanlab-paperspace-automatic1111v1.ipynb
```
## Usage
Run the cells in the Jupyter Notebook to install and set up AUTOMATIC1111 on your Paperspace virtual machine. The Notebook contains detailed instructions and code for each step.
## Screenshots
Include screenshots or demo videos of the project here.

## Contributing
Contributions are welcome! To contribute, please follow these steps:
1. Fork the repository.
2. Create a new branch with your changes.
3. Create a pull request to the main branch.
For bug reports, please open an issue on the GitHub repository.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Contact
For questions or bug reports, please use the following methods:
- GitHub Issues: https://github.com/Murasan201/paperspace-automatic1111/issues
- Email: example@example.com
生成されたREADME.mdをVS Codeで確認する
先ほどGPT-4で生成したコードで正しく表示されるかの確認を行います。
確認にはMicrosoft社のVisual Studio Codeを使用します。
VS Codeのインストール方法は以下の記事で解説しています。

まず、先ほどGPT-4が生成したコードのコピーボタンをクリックしてクリップボードコピーします。

VS Codeで空のREADME.mdを作成し、コピーしたソースを貼り付けます。

VS Codeの画面右上のプレビューボタンをクリックします。

するとコードのとなりにプレビューが作成され、正しく表示されることが確認できました。

ChatGPTのテクニックを仕事に生かすには
話題のChatGPTですが、具体的に「どうやって自分の仕事の業務に活用すればいいかわからない」、という方も多いのではないでしょうか?
周りでは、「実際に新しい技術のキャッチアップするのが速い人が、どんどん業務に取り込んで効率化して成果を出していて焦る…」といったこともあるとか思います。
そんな時はやはり業界のプロフェッショナルから学ぶのがおすすめです。
タノメルキャリアスクールは、未経験の個人、法人がキャリアアップするためのスクールです。

ChatGPTを始めとした生成AIの使いこなし術から、そのバックグラウンドにある機械学習の技術、そしてマーケティング、プロモーションなどの実務への展開方法を詳しく学ぶことができます。
- 学び放題: サービスは学び放題の形態を取っており、定額で多くの知識とスキルを身につけることができます。(ChatGPT/生成AI(30講義)、Python/機械学習(30講義)、Biz(30講義)、他(10講義)、合計100講義学び放題)
- 充実のサポート: SlackやLINEでのチャットサポートに加え、週一回Zoom相談会も実施。
- 有名講師: 業界で名高い講師が指導にあたっており、質の高い講義が受けられます。
講師陣も豪華で、Pythonのプログラミング講師はX(旧Twitter)でも有名なみやさかしんやさんをはじめ、業界の著名陣が担当されています。
タノメルキャリアスクールで学ぶことによって、ChatGPTのような生成AIを使って、日々の業務を効率化したり、新しいアイディアを生み出したりできるようになります。
AIの力で仕事をもっとスマートに、もっとクリエイティブに進めることができるようになれば、同僚や上司からも一目置かれる存在に!
生成AIを活用し、新しいビジネスチャンスを創出しましょう!
\ カリキュラムを見てみる! /
まとめ
今回はOpenAIの自然言語モデルGPT-4を使って、GitHubのREADME.mdを作成する方法を解説しました。私のようなめんどくさがりにはREADME.mdを手で書くのはかなり苦痛な作業でしたが、GPT-4で簡単に自動生成でき、苦も無く生成できるようになりました。README.mdを書くのはめんどくさいな~と思っていた方には非常におすすめですので、ぜひ活用してみてください。
また、以下の記事で効率的にPythonのプログラミングスキルを学べるプログラミングスクールの選び方について解説しています。最近ではほとんどのスクールがオンラインで授業を受けられるようになり、仕事をしながらでも自宅で自分のペースで学習できるようになりました。
スキルアップや副業にぜひ活用してみてください。

スクールではなく、自分でPythonを習得したい方には、いつでもどこでも学べる動画学習プラットフォームのUdemyがおすすめです。
講座単位で購入できるため、スクールに比べ非常に安価(セール時1200円程度~)に学ぶことができます。私も受講しているおすすめの講座を以下の記事でまとめていますので、ぜひ参考にしてみてください。

それでは、また次の記事でお会いしましょう。

