スキップしてメイン コンテンツに移動

投稿

12月, 2025の投稿を表示しています

Making LLMs Read Word Files with Equations: Developing eqword2llm

  As a researcher, I frequently work with Word files in my daily work. When I want to have AI assistants analyze technical documents containing mathematical equations, I encountered a problem. When you pass Word files directly to LLMs, equations are not correctly recognized. To solve this challenge, I developed  eqword2llm . The Challenge: Why Existing Tools Are Insufficient Limitations of Pandoc Pandoc is an excellent conversion tool, but it cannot fully handle Word-specific issues. For example, when converting a document that uses Word's equation numbering feature: Equation with Field Code $ $ \begin {array}{r} \mathbf {E = m} \mathbf {c} ^ { \mathbf {2}} \mathbf { \# } \left ( \mathbf {} \mathbf { \ SEQ \ Equation \ \backslash * \ ARABIC \ } \mathbf {} \mathbf {1} \mathbf {} \right ) \end {array} $ $ Another Equation $ $ \begin {array}{r} \mathbf {F = ma \# } \left ( \mathbf {} \mathbf { \ SEQ \ Equation \ \backslash * \ ARABIC \ } \mathbf {} \mathbf {2} \mathbf {} \rig...

数式入りWordファイルをLLMに読ませる:eqword2llmの開発

研究者として日々の業務でWordファイルを扱う機会は多い。特に数式を含む技術文書をAIアシスタントに分析させたいとき、ある問題に直面した。 WordファイルをそのままLLMに渡しても、数式が正しく認識されない。 この課題を解決するために開発したのが  eqword2llm  だ。 課題:なぜ既存ツールでは不十分なのか Pandocの限界 Pandocは優秀な変換ツールだが、Word特有の問題に対応しきれない。 たとえば、Wordの数式番号機能を使った文書を変換しようとする。 Pandocだと、以下のように変換される。 Equation with Field Code $ $ \begin {array}{r} \mathbf {E = m} \mathbf {c} ^ { \mathbf {2}} \mathbf { \# } \left ( \mathbf {} \mathbf { \ SEQ \ Equation \ \backslash * \ ARABIC \ } \mathbf {} \mathbf {1} \mathbf {} \right ) \end {array} $ $ Another Equation $ $ \begin {array}{r} \mathbf {F = ma \# } \left ( \mathbf {} \mathbf { \ SEQ \ Equation \ \backslash * \ ARABIC \ } \mathbf {} \mathbf {2} \mathbf {} \right ) \end {array} $ $ SEQ Equation  というWordの内部フィールドコードがそのまま出力されてしまう。これではLLMが数式を正しく理解できない。 Mammothの限界 Mammothは数式を完全に無視する。見出し構造は保持されるが、肝心の数式が消えてしまっては科学技術文書には使えない。 eqword2llmの特徴 1. クリーンなLaTeX出力 同じ文書をeqword2llmで変換すると: Equation with Field Code $ $ E=mc ^ {2} $ $ Another Equation $ $ F=ma $ $   フィールド...