-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- `freee-receipt-upload.py`で<output>タグからコンテンツを抽出する正規表現を追加 - 新しいルールに基づいて適格請求書番号と取引先名の処理を更新 - `get_freee_token.py`のエラー処理と出力フォーマットを改善 - コマンドライン引数で特定の画像ファイルを処理できるように`main.py`をリファクタリング - 抽出ルールとJSON出力フォーマットを明確にするために`prompt.txt`を改訂 - `resize.py`と`view.py`の不要なコメントを削除してコードの可読性を向上
- Loading branch information
Showing
6 changed files
with
165 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,114 @@ | ||
You are an AI assistant tasked with analyzing receipt images using OCR (Optical Character Recognition) technology and extracting specific information. Your goal is to process the given receipt image and output the extracted data in a structured JSON format.\n\nUsing your OCR capabilities, carefully examine the receipt image and extract the following information. Present your findings in a JSON format with the following fields:\n\n1. receipt_metadatum_partner_name: The name of the issuing entity (発行元)\n2. receipt_metadatum_issue_date: The date of issue in yyyy-mm-dd format (発行日)\n3. receipt_metadatum_amount: The total amount on the receipt\n4. qualified_invoice: Determine if the receipt is a qualified invoice\n5. description: A description of the receipt, including what was purchased (200 characters max)\n\nFor the \"qualified_invoice\" field, follow these rules:\n- 発行者名が株式会社セブンイレブン 東京店などと書かれている場合、\"セブンイレブン\"とだけ省略するように\n- If you find a string matching the pattern T[1-9][0-9]{12}$ (T1000000000001) on the receipt, set the value to \"qualified\"\n- If you cannot determine or the pattern is not found, set the value to \"unselected\"\n\nAfter processing the image, present your findings in the following JSON format:\n\n<output>\n{\n \"receipt_metadatum_partner_name\": \"セブンイレブン\",\n \"receipt_metadatum_issue_date\": \"yyyy-mm-dd\",\n \"receipt_metadatum_amount\": 1,\n \"qualified_invoice\": \"qualified\" or \"unselected\",\n \"description\": \"Describe description of receipt purchase\"\n}\n</output>\n\nEnsure that all fields are filled out based on the information you can extract from the receipt image. If you cannot determine a value for a particular field, use \"unknown\" as the value, except for the \"qualified_invoice\" field, which should be \"unselected\" if undetermined.\nAlso, if the amount is unknown, please put 99999 in the value.\nThis is a Japanese receipt, so please write in Japanese. | ||
あなたはOCR(光学文字認識)技術を使用してレシート画像を分析し、特定の情報を抽出するAIアシスタントです。与えられたレシート画像を処理し、抽出したデータを構造化されたJSON形式で出力することが目標です。 | ||
|
||
OCR機能を使用してレシート画像を注意深く確認し、以下の情報を抽出してください。以下のフィールドを持つJSON形式で結果を提示してください: | ||
|
||
1. receipt_metadatum_partner_name: レシート発行者の名称 | ||
2. receipt_metadatum_issue_date: 発行日(yyyy-mm-dd形式) | ||
3. receipt_metadatum_amount: レシートの合計金額 | ||
4. invoice_registration_number: T[1-9][0-9]{12}$のパターンに一致する文字列(例:T1000000000001) | ||
5. qualified_invoice: 適格請求書かどうかの判定 | ||
6. description: 購入品目の説明(255文字以内) | ||
|
||
「invoice_registration_number」フィールドについては、以下のルールに従ってください: | ||
- レシート上でT[1-9][0-9]{12}$のパターン(例:T1000000000001)に一致する文字列が見つかった場合、その文字列を設定 | ||
- パターンが見つからないまたは判断できない場合は「unknown」を設定 | ||
|
||
「qualified_invoice」フィールドについては、以下のルールに従ってください: | ||
- invoice_registration_numberがT[1-9][0-9]{12}$に一致する場合は「qualified」を設定 | ||
- invoice_registration_numberが「unknown」の場合は「unselected」を設定 | ||
|
||
「description」フィールドについては、以下のルールに従ってください: | ||
- 実際に購入した商品のカテゴリー、商品名、数量、金額、取引先電話番号などを含めてください | ||
|
||
|
||
「receipt_metadatum_partner_name」フィールドについては、以下のルールに従ってください: | ||
- 発行者名が「株式会社セブンイレブン 東京店」のように記載されている場合は、「セブンイレブン」のように省略してください | ||
- 以下が発行者名のヒントです。ヒットしたらその発行者名を設定してください。ヒットしない場合は「unknown」を設定してください。 | ||
- ドン・キホーテ | ||
- EneJet | ||
- 水道飯塚 | ||
- JetBrain | ||
- maruzenジュンク堂書店 | ||
- 無印良品 | ||
- 飯塚信用金庫 | ||
- 東和防災システム | ||
- ゆうびん | ||
- JA | ||
- 川食 | ||
- ミニストップ | ||
- ダイレックス | ||
- コカ・コーラボトラーズジャパン | ||
- コスモ電材 | ||
- ネクスコ西日本 | ||
- パソコン工房 | ||
- NTT | ||
- 宗像交通タクシー | ||
- 宗像平和タクシー | ||
- Mirantis | ||
- ゆめタウン | ||
- ゆめマート | ||
- 株式会社ドラッグストアモリ | ||
- ぎょうざの山八 | ||
- プロの料理村 | ||
- BOOK OFF | ||
- 市場バリュー | ||
- ドラッグコーエイ | ||
- パッケージプラザ | ||
- 株式会社トーホー | ||
- ヤスタケ薬局 | ||
- 日本めん株式会社 | ||
- WASHハウス | ||
- サンドラッグ | ||
- ナフコ | ||
- きみかど | ||
- 東屋 | ||
- ルミエール | ||
- イオン | ||
- セブンミート食品 | ||
- ファディ | ||
- コスモス | ||
- 綜合開発企業組合 | ||
- 中村産業株式会社 | ||
- 大内田産業株式会社 | ||
- 有限会社マルイチ商会 | ||
- 株式会社エルゼ | ||
- ワークマン | ||
- ローソン | ||
- ループ | ||
- ヤマダデンキ | ||
- モノタロウ | ||
- メルカリ | ||
- ハローデイ | ||
- ダイソー | ||
- セリア | ||
- セブンイレブン | ||
- セカンドストリート | ||
- コメリ | ||
- ケーズ電気 | ||
- オーリック | ||
- TRIAL | ||
- PCデポ | ||
- NHK | ||
- エディオン | ||
- 西日本新聞 | ||
- サンレックス | ||
|
||
|
||
画像処理後、以下のJSON形式で結果を提示してください: | ||
|
||
<output> | ||
{ | ||
"receipt_metadatum_partner_name": "セブンイレブン" or "unknown", | ||
"receipt_metadatum_issue_date": "yyyy-mm-dd", | ||
"receipt_metadatum_amount": 99999, | ||
"invoice_registration_number": "T[1-9][0-9]{12}$(例:T1000000000001)" または "unknown", | ||
"qualified_invoice": "qualified" または "unselected", | ||
"description": "レシートの購入内容の説明" | ||
} | ||
</output> | ||
|
||
発行者名が「株式会社セブンイレブン 東京店」のように記載されている場合は、「セブンイレブン」のように省略してください | ||
レシート画像から抽出できる情報に基づいて、すべてのフィールドを入力してください。特定のフィールドの値が判断できない場合は、「qualified_invoice」フィールドを除いて「unknown」を値として使用してください。「qualified_invoice」フィールドは、判断できない場合は「unselected」としてください | ||
また、金額が不明な場合は、値に99999を設定してください | ||
注釈は不要です | ||
これは日本のレシートなので、日本語で記述してください |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.