LoginSignup
1
1

More than 1 year has passed since last update.

特許庁公開IPC分類表(excel)からIPC説明リストを作る

Last updated at Posted at 2023-03-18

1. はじめに

特許出願の公報には、複数の特許を分類するIPC(国際特許分類)のコードがふられています。しかし、特許情報をお金をかけず分析するには、別途このIPCとその説明が対応付けられたデータを確認することになります。また、IPCは階層構造になっていて、全体を検索することが面倒です。
そこで、今回お金をかけずに特許庁公開IPC分類表(excel)からIPCの意味をpython(jupyterノートブック)で見つける練習をしてみました。

2. 事前準備

事前準備として次の1〜3をしました。

  1. 特許庁「IPC分類表及び更新情報(日本語版)」の<EXCEL>よりxlsxをzipファイルをダウンロードする。
  2. zipファイルを展開し、その中の全てのxlxsファイルをフォルダ「ipc」に入れる。
  3. 上記2のフォルダ「ipc」の上に以下のスクリプトファイルを作成する。

3. IPC説明リスト作成関数(ipcTitle)の作成

上記の事前準備で作成したフォルダ「ipc」内のxlxsファイルを参照して、IPCの説明をリスト形式で出力する関数ipcTitleを作成しました。

ipcList.ipynb
# pandasのインポート
import pandas as pd

#関数を作成
def ipcTitle(search_ipc):
    # excelファイルを読み込んでDataframeに(xlsxファイルの保存先に注意)
    # excelファイルの頭の IPC_Ver2023 あたりは毎年変わっていそうなので注意が必要。
    df = pd.read_excel('ipc/IPC_Ver2023-'+ search_ipc[0] +'section.xlsx')
    
    # Dataframeスペース調整
    df['記号']=df['記号'].str.replace(' ', '')
    
    # 調べたいDataframeのレコードを特定
    search_record = df[df['記号']==search_ipc]
    
    # 調べたいDataframeのレコードのドットを特定    
    search_dot = search_record.iloc[:,2].to_list()[0]
    
    # 調べたいDataframeのレコードの行(index)を特定    
    search_record_no = search_record.index.to_list()[0]

    # 調べたいDataframeのレコードのタイトルを特定    
    search_title = search_record.iloc[:,3].to_list()[0]
    
    # 上のタイトルを配列にいれる
    if search_dot ==  '・・・・' or search_dot ==  '・・・' or search_dot ==  '・・' or search_dot ==  '':
        search_title_list = [search_dot + search_title]
    else:
        search_title_list = [search_title]        
    
    # ドットの数に応じて、配列にタイトルを追加する
    if search_dot == '・・・・':
        title = df[(df.index <= search_record_no) & (df['ドット']=='・・・')].tail(1).iloc[:,3].to_list()[0]
        #search_title_list.append('・・・' + title)
        search_title_list.insert(0, '・・・' + title)
        search_record_no = df[(df.index <= search_record_no) & (df['ドット']=='・・・')].tail(1).index.to_list()[0]
        search_dot = '・・・'
    if search_dot == '・・・':
        title = df[(df.index <= search_record_no) & (df['ドット']=='・・')].tail(1).iloc[:,3].to_list()[0]
        # search_title_list.append('・・' + title)
        search_title_list.insert(0, '・・' + title)
        search_record_no = df[(df.index <= search_record_no) & (df['ドット']=='・・')].tail(1).index.to_list()[0]
        search_dot = '・・'
    if search_dot == '・・':
        title = df[(df.index <= search_record_no) & (df['ドット']=='')].tail(1).iloc[:,3].to_list()[0]
        #search_title_list.append('・' + title)
        search_title_list.insert(0, '' + title)
        search_record_no = df[(df.index <= search_record_no) & (df['ドット']=='')].tail(1).index.to_list()[0]
        search_dot = ''
    if search_dot == '':
        title = df[(df.index <= search_record_no) & (df['ドット'].isnull())].tail(1).iloc[:,3].to_list()[0]
        #search_title_list.append(title)
        search_title_list.insert(0, title)

    return(search_title_list)

4. 使用例

試しに、IPC「A63F13/86」の意味を関数ipcTitleで確認します。

test1_ipcList.ipynb
search_ipc1 = "A63F13/86"
IPCtitle1 = ipcTitle(search_ipc1)
print(IPCtitle1)

実行結果は、

['ビデオゲーム,すなわち2次元以上の表示ができるディスプレイを用いた電子ゲーム[7,2014.01]', '・プレイヤーへの付加的なサービスの提供[2014.01]', '・・他のプレイヤーがプレイするゲームの観戦[2014.01]']

となります。

これは、以下の内容を示しています。

  • IPC「A63F13/86」の説明は'・・他のプレイヤーがプレイするゲームの観戦[2014.01]'である。
  • IPC「A63F13/86」の一つ上の層のIPCの説明は'・プレイヤーへの付加的なサービスの提供[2014.01]'である。
  • IPC「A63F13/86」の二つ上の層のIPCの説明はビデオゲーム,すなわち2次元以上の表示ができるディスプレイを用いた電子ゲーム[7,2014.01]'である。
1
1
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
1
1