top of page


Local LLM Creation
ローカルLLMでAI-OCRを作ってみた話(検証と壁)
休憩中のニュースで見つけた「自分のPCで無料で商用利用も可能なLLMを構築できる」という魅力的な情報。これを機に、以前自作したAI-OCRのAI部分をローカルLLMに置き換えて検証してみました。
参考ドキュメント:https://www.lmstudio.ai/docs/app
期待を胸に帳票を読み込ませたところ、思わぬ事態が発生。なんと「株式会社Hoge」が「naito」と誤読されてしまいました。原因を追うと、LLMではなく前段のPython OCRライブラリの文字認識やレイアウト解析が破綻していたためでした。
ローカルLLM活用の夢と可能性を感じつつも、実用化に向けたOCR精度の壁という現実的な課題が見えた興味深い検証となりました
Jul 211 min read


AI-Powered Management Decision Support System (MDSS) Development Notes3
今日は、AIを活用したManagement Decision Support System(MDSS)のチャット機能を改善しました。これまでの課題は、「Hello」のような挨拶でもAIが経営分析を始めてしまうことでした。原因は、通常チャットでも分析前提のプロンプトを使用していたためです。今回、業務に関する質問のみ分析データを参照し、それ以外は通常の会話として応答するよう設計を見直しました。一方で、What-if分析やフォローアップはLLMによる推論が不可欠なため、APIを呼び出す構成としています。AI・データベース・アプリケーションの役割分担を設計することが、使いやすさと運用コストの両立につながります。
Jul 32 min read


AI-Powered Management Decision Support System (MDSS) Development Notes2
During this development cycle, I solved a Gemini API 429 error, redesigned the MDSS architecture, and fixed a Streamlit layout issue. The API problem was caused by using the wrong model (gemini-2.0-flash instead of gemini-2.5-flash). After correcting it, the application worked normally. I also changed the system from AI-first processing to a database-first design, using AI only for updates to reduce API usage and improve response time. Finally, I removed duplicate chat render
Jun 282 min read


AI-Powered Management Decision Support System (MDSS) Development Notes
This project aims to build a management decision support system by integrating AI APIs into business operations. By synthesizing data on sales, markets, competitors, and news, the system automates the structuring of complex management issues and hypothesis generation through tools like status analysis, PDCA proposals, and mind mapping, providing high-quality materials for human decision-making.
During development, I addressed practical challenges such as API limits and costs
Jun 243 min read


AIOCR
2年越しにAI-OCRの構築へ着手しました。今回は圧倒的な学習量を誇る大手AI(Gemini-2.5-flash)を使い、データ構造をガチガチに固定する設計です。
核となるのは「判定 ➔ 抽出」の2段階パイプライン。1回目で帳票種別と顧客を判定し、2回目で顧客ごとのルールを動的に適用して高精度に抽出する構想です。
手始めに、手元のPDFから「未知の顧客(UNKNOWN)」として項目を抜き出すベース処理をテストしたところ、狙い通り綺麗なJSONが出力されました!
Jun 142 min read


I tried making an AI 4
自身の性格や考え方を反映したAIを目指し、Webブラウザ上で会話可能な「Taka AI」の試作機を開発した。「黒い画面」の無機質さを解消するため、スマホの絵文字のような顔を導入し、侮辱ワードに怒るなどの感情表現を実装してキャラクター性を意識した。
技術面での大きな成果は、FastAPIを用いてAIをAPI化したことだ。これにより、ブラウザからHTTP通信を介してPythonプログラム上のAIとやり取りする構成が実現した。
現状は大規模言語モデルではなく、検索に基づいた回答を行う仕組みだが、学習データは蓄積されるため改善が可能だ。今後は体験談や価値観をパラメータへ反映し、「自分らしく考え、反応するAI」への進化を目指す。試作段階ではあるが、API化から感情表現の実装までの一連の開発経験は、今後の拡張に向けた確かな土台となった。
Jun 103 min read


I tried making an AI 3
本プロジェクトは、AIが固定的なモデルではなく、個人の体験を記憶・学習し、常に変化する「動的人格」を実現する試みです。
コアとなる仕組みは、「体験ログ」を起点とした性格パラメータのリアルタイム更新です。ユーザーが日常の出来事を「記憶して」と伝えるだけで、システムは文脈を解析し、パラメータを恒久的に書き換えます。これにより、二日酔いや人間関係による心境の変化など、人間固有の「ゆらぎ」をAIの思考プロセスに同期させます。
技術的には、テキストの数値化(ベクトル演算)を軸に、DB、pandas、numpyを統合。対話するたびに最適化されたプロファイルを反映するサイクルを構築しました。「文章を数字として計算・判断する」というAIの本質を拡張し、特定の人物の行動や思考の癖を動的に再現する。この手法は人格シミュレーションにおける強力なプラットフォームとして、広範な応用可能性を秘めています。
Jun 72 min read


Let's try making an AI 2
AI開発において、学習データの管理方法を見直しました。データ量の増加に伴い、手動メンテナンスの負荷と拡張性に限界を感じたため、Python環境にSQLiteを導入し、データ構造を刷新しました。
今回実装した技術的アプローチ:
SQLiteの導入: 学習データと性格データを構造化し、管理効率を向上。
ゆらぎ吸収(n-gram): 表記の揺らぎ(例:「こんにちは」「こんちは」)による冗長なレコード作成を防ぐため、TfidfVectorizer (char, 2-3) を実装し、検索精度を維持。
キャッシュ最適化: 再学習コストを抑えるため、更新フラグ付きのキャッシュ機構を実装。
気付きと課題:
AI開発において、正しい情報を教える以上に「誤ったデータを効率的に忘れさせる」仕組みの実装が最も難しいと痛感しました。
次のステップ:
現在は検索エンジンに近い状態ですが、今後は保持している性格データを動的に反映し、状況に応じた「自分らしい回答」を生成するパーソナリティ層の実装を進めます。技術を「自分」というOSにどう統合するか、引き続き追求してい
Jun 33 min read


Let's try making an AI 1
AI開発ログ:VBAからPythonへの移行
1. 手書きルールにトリガーワードを組み込む
2. 実行用にCSVで人格プロファイルを設定する
3. 人格値(礼儀正しさ、深みなど)をレスポンスロジックに紐付ける
4. ディープラーニングのリソースを統合する
5. ニュートラルなAI開発はここから始まる
ロジックの進化: ハードコーディングされた IF-ELIF 構造から、モジュール化されたアーキテクチャへの移行。
手法: Pythonを使用して、静的なルールベースシステムから高度なニューラルネットワークへと進化させる。
目標: 個別の要件に基づいた、パーソナライズされたAIエージェントの開発
May 303 min read


Data Extraction and SQL using PowerShell
Pythonがインストールされていない環境において、PowerShellを活用して大容量のデータ抽出を行う際、記述が容易な「CSVパイプ処理(Import-Csv)」と、やや煩雑な「OLEDBによるSQL処理」のどちらを採用すべきか、実機検証を交えて徹底比較しました。数千行程度の手軽な処理であれば1行で直感的に記述できるパイプ処理が最適ですが、データ量が数万行から10万行を超える規模になると、全データをオンメモリで処理するパイプ方式ではメモリの大量消費や深刻な速度低下(フルスキャン)を引き起こすリスクがあります。一方で、OLEDBを介してデータベースエンジン側に処理を委任するSQL方式は、コードが冗長でOfficeのビット数(32bit/64bit)に依存する制約があるものの、必要なデータのみを最適化してスマートに取得できるため、劇的な省メモリと高速化を実現できます。本記事では、Excel 2007から最新のOffice 365環境における接続文字列の記述方法や、実務で嵌まりがちな環境依存のエラー対処法まで、データ量に応じた最適な住み分けの目安を
May 273 min read


Notes on handling CSV and Arrays in Python
PythonでのExcel操作にはopenpyxlライブラリを使用し、ファイルを読み込んで操作できることを確認しました。また、辞書型を用いた配列の入力と表示方法を学びました。出先で実ファイルが置けないWeb環境(paiza)では、io.StringIOを用いて文字列にファイルのふりをさせ、疑似的にcsv.readerに渡して実行しました。CSVの読み込み方式には、行ごとに単純なリストにするcsv.readerと、1行目を項目名として各行を項目名付きデータにするcsv.DictReaderの違いがあることを理解しました。自宅のローカル環境で実行した際にはエラーが発生しましたが、これはファイルパス内の「\t」がエスケープシーケンス(タブ文字)と解釈されたことが原因でした。対策として、パスの区切りをスラッシュにするか、文字列の前に「r」を付けて特殊文字扱いを無効化することで、正しくファイルが読み込めるようになりました。
May 212 min read


IF YOU CAN WRITE THE FLOW YOU CAN DO ANYTHING
- Realizing my former boss's words in PowerShell I created a simple analysis script in PowerShell to inspect the contents of data involving character encodings. The motivation was a situation where I needed to verify file contents in a human-readable format, and I took the opportunity to try it out as part of my learning. While the implementation itself was partially generated by AI, I provided the overall flow (the comments in the PowerShell file at the bottom) and the encod
May 173 min read


Operating Excel using Python
Overcoming the Barriers of Environment Setup 1. Objective The primary goal was to use Python to write "Hello" into cell A1 of a specified Excel file. 2. Tools & Libraries Editor: VS Code (Visual Studio Code) Environment: Python 3.12.1 Library: openpyxl (for Excel manipulation) 3. Troubleshooting & Solutions I encountered initial issues with VS Code extension errors and Windows PATH configuration preventing command recognition. Issue 1: Unable to execute pip install. Solution:
May 111 min read


"Is That Really All It Takes?
Pythonを書いて見た結果。
May 102 min read
About Power Automate
It's been ages since my last post. I've reached this point after repeatedly experiencing setbacks and restarts. A lesson learned. Looking back at my blog, it seems I've been neglecting it for about a year. To begin with, I'm slow to realize things. I only realized this again after restarting this project. Here's a summary: 1. Power Automate has two products, and I mistakenly assumed that both could be developed in the same way. a, Power Automate Cloud As the name suggests, th
May 72 min read
PowerAutomate & Office Script 4
In a world where VBA is prohibited, we tried every trick in the book—but the conclusion we reached was that it was "unrealistic." 🧭 Introduction One day, VBA was suddenly banned. The alternatives that emerged were Power Automate and Office Script. The objective is clear: "Paste the SAP VA05 report into Excel, format the content, and send it by email"—that's all. However, this "simple" automation required more detours than anticipated and the decision to "give up" on c
Apr 173 min read


Power Automate & Office Script 3
When I asked Copilot to generate an Office Script, the code was output surprisingly quickly. When I ran it in Excel on OneDrive, the data...
Jun 23, 20252 min read


PowerAutomate & Office Script2
Since I had high expectations based on the previous content, I first pasted the values into Excel as the UI, I pressed the button. Update...
Jun 16, 20252 min read


PowerAutomate & Office Script1
After I was removed from the RPA work, I did not do anything for a while. But as I continued to live like this, I suddenly wondered, "Is...
Jun 9, 20251 min read


About the OCR function
I don't mean to disrespect our business partners, but some of our customers still use fax machines. This also requires the data to be...
Aug 1, 20242 min read
bottom of page