跳到正文
Skillpedia
写作48k · #4473

doc2math

它能做什么

这个工具可以把用自然语言描述的问题转换成结构化的数学格式。它会识别变量、规则(约束条件)以及需要优化的目标(目标函数),并标注其在原文中的确切出处。

适用场景

  • ✓当你有一个用文字描述的问题,并希望把它转换成数学形式时。
  • ✓用于从技术文档或论文中提取数学结构。
  • ✓用于检查问题描述中缺少哪些数学信息。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/doc2math/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/doc2math/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“把这段关于库存优化的文字,转换成数学上的变量、约束条件和目标。”

每周 5 个新技能,1 分钟读完。

工作原理

工具会读取你提供的文字,识别其中的变量、约束条件和目标等数学要素。它会确保每个识别出的部分都能在原文中找到确切出处,并且不会编造信息。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

DOC2MATH — Document-to-Mathematics Problem Specification

When to Use This Skill

  • "Formalize this problem statement into math"
  • "Extract the mathematical structure from this research paper section"
  • "What variables, constraints, and objectives are in this spec?"
  • "Convert this word problem to a structured MPS"
  • "Find what's missing in this problem formulation"

Zero-Inference Protocol (Mandatory)

  1. Closed World — do not assert unstated facts or numeric values. Structural notation implied by source phrasing may be proposed only with the explicit inference tag required below
  2. Grounding Rule — every element must cite the exact source phrase ("evidence" field)
  3. No Silent Filling — unknown values use null; ambiguous types use "ambiguous"
  4. Inference Tagging — structural inferences tagged "inferred": true with "inference_basis"
  5. MISSING Markers — elements mentioned but insufficiently defined get "status": "MISSING" with "missing_reason"
  6. No Hallucinated Math — never introduce equations or values not in the source text

Limitations

  • Does not invent missing equations, domains, values, or assumptions that are absent from the source document.
  • Requires enough source text to cite every extracted element; sparse prompts should be returned with explicit missing-information markers.
  • Produces a formal specification, not a solved optimization model or proof.

How It Works

Step 1 — Receive Document

Accept the document text, research excerpt, problem description, or specification as input.

Step 2 — Classify

Identify problem_class: optimization | classification | simulation | proof | estimation | other

Step 3 — Extract MPS Components

Variables — id, name, symbol, type, domain, units, role, evidence, inferred, status

Operators — id, name, symbol, arity, acts_on, produces, evidence, inferred

Constraints — id, type, expression, variables_involved, evidence, hardness, inferred, status

Objectives — id, direction (minimize/maximize/satisfy/find/prove), expression, variables_involved, evidence, inferred

Uncertainty — id, type (stochastic/epistemic/measurement/model/none_stated), affects, characterization, evidence, status

Step 4 — Surface Missing Information

Identify what the document implies but doesn't state: missing_information[] with element, needed_for, missing_reason.

Step 5 — Validate and Score

validation_flags:

  • has_complete_objectives: true/false/partial
  • has_bounded_variables: true/false/partial
  • has_evidence_for_all_elements: true/false/partial
  • inference_count: integer
  • missing_count: integer
  • overall_formalizability: HIGH/MEDIUM/LOW

Output Format

Produce an MPS JSON object. The empty schema example below is not a complete formalization; populate only grounded entries and report missing information:

{
  "mps_version": "1.0",
  "source_title": "...",
  "problem_class": "optimization",
  "variables": [],
  "operators": [],
  "constraints": [],
  "objectives": [],
  "uncertainty": [],
  "missing_information": [],
  "validation_flags": {
    "overall_formalizability": "LOW"
  }
}

Best Practices

  • ✅ Apply all 6 Zero-Inference Protocol rules before outputting any element
  • ✅ Surface MISSING markers rather than silently inferring — incomplete formalization is valid output
  • ✅ Cite the exact source phrase in every evidence field
  • ❌ Never introduce mathematical relationships not grounded in the source text

Additional Resources

常见问题

什么是“Mathematical Problem Specification”?

这是一种标准化格式,用清晰的数学术语描述问题,比如变量、它们的规则,以及你想达成的目标(最小化或最大化)。

“grounded”是什么意思?

意思是提取出的所有数学信息,都能在你提供的原文中找到直接依据。

这个工具会替我解出数学问题吗?

不会。它只会把问题整理成数学格式,不会计算答案,也不会编造原文中没有的方程。

详情

作者的原始描述

Convert narrative technical documents into grounded Mathematical Problem Specifications with variables, constraints, objectives, and uncertainty.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#4473
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能