SYSTEM NOTICE

Auto translation by AI. Be sure, accuracy, nuances and authorial intent may not be fully reflected.
見出し画像

We have launched a system that uses AI to automatically turn Takahiro Anno's policy updates into articles!

I am Ito, the Technical Team Leader for the Takahiro Anno office.

The Takahiro Anno team is working on an initiative called "Open Source Policy Development" to realize our vision of "creating a Tokyo that leaves no one behind through technology".

To make this initiative easier to understand and keep up with, we have created a system that uses AI to periodically turn manifesto updates into articles, which I will introduce in this post.


Background: About Open Source Policy Development

Open Source Policy Development is an initiative where we solicit opinions from citizens regarding Takahiro Anno's manifesto and improve policies through a two-way process.

The three pillars of Takahiro Anno's technology-driven policy

Specifically, we publish the policy repository on GitHub, solicit improvement proposals via Pull Requests, and update the manifesto by incorporating changes that the policy team and Takahiro Anno himself deem appropriate directly onto the policy page immediately.

Results of change proposals over the first 8 days

In fact, since the launch, we have received 157 issues raised, and 41 of them have been implemented, which I believe shows we are reflecting policy changes with a good sense of speed.

Challenges

While some parts are working well, we have received feedback that although each individual discussion and change is open, it is practically difficult to keep track of the changes as a whole, and I agree with that sentiment.

Therefore, we have created and launched a system to visualize, summarize, and publish information on what kind of policies are being reflected and in what numbers. You can see the actual published article here.

The actual published article

In this article, I would like to write about how that system works.

Overview of the system

This tool was created using Google Colab.

The actual Google Colab screen

The process is simple and does the following:

  1. Retrieves a list of Pull Requests from the GitHub API

  2. Filters for Pull Requests that meet the criteria

    • merged_at is within the target period

    • includes file diffs under doc/manifest

  3. Send the Pull Request File Diff data and the discussion page HTML to ChatGPT to create a summary

  4. Visualize the diff using MatPlotLib

  5. Display the HTML-formatted content on Colab

  6. Copy and paste directly into note

Below, I will briefly introduce the parts I put effort into.

Using ChatGPT

I am making requests to ChatGPT using the following prompt.

Since the changes themselves can be understood by looking at the diff, I send the HTML of the GitHub Pull Request page, and I emphasize explaining the background, including what kind of discussions took place and what decisions led to the merge.

Also, when turning it into an article, it is easier to read if content directly related to policy is at the top, so I have it score the importance in three levels here, and reorder them in the order of 1 (addition/change of policy content) -> 2 (correction of expressions or information). (I have decided not to include 3, as it is just a typo or similar, to prevent the article from becoming difficult to read.)

下のgithubのマージ済みのプルリクエストのHTMLとdiffを読み、内容を日本語で要約してください。

## 回答フォーマット
{{
  "title": "変更内容を示すタイトル(30字以内)"
  "summary": "変更自体の概要(100~200文字程度)"
  "background: "そのPRをマージするに至った背景(100~200文字程度)"
  "importance": 1 // そのPRの重要性(1-3)
}}

## diffは以下です。
{diff}

## HTMLは以下です。
{html}

## importanceの定義
- 実質的な政策内容の追加・変更を含むもの: 1
- 表現の修正や情報の詳細化など: 2
- タイプミスや誤字脱字の修正など: 3

Diff Visualization

Regarding the diff, I originally wanted to visualize it semantically using HTML or similar, but it seemed difficult to express well on the note editor function, so I am converting it into an image using matplotlib.

Diff file

That is all. I have attached the article creation tool I created this time below. If you are interested, please take a look.

Summary

Once again, in order to make open-source policy development function well, I believe that simply making it public and searchable is not enough; it is more important than anything to communicate it in a form that is actually easy to see and understand.

I hope that this initiative of periodically publishing the diffs will be meaningful for everyone in understanding the policies and thinking about further improvement proposals.

At the Takahiro Anno office, we will continue to update our systems as necessary so that you can feel that there is a more promising political system. If you have any opinions, please feel free to send them to us!


For those interested in Takahiro Anno