@wentorai/research-plugins 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -18
- package/curated/analysis/README.md +12 -1
- package/curated/domains/README.md +48 -1
- package/curated/literature/README.md +46 -1
- package/curated/research/README.md +16 -1
- package/curated/tools/README.md +20 -1
- package/curated/writing/README.md +13 -1
- package/mcp-configs/academic-db/alphafold-mcp.json +20 -0
- package/mcp-configs/academic-db/brightspace-mcp.json +21 -0
- package/mcp-configs/academic-db/climatiq-mcp.json +20 -0
- package/mcp-configs/academic-db/gibs-mcp.json +20 -0
- package/mcp-configs/academic-db/gis-mcp-server.json +22 -0
- package/mcp-configs/academic-db/google-earth-engine-mcp.json +21 -0
- package/mcp-configs/academic-db/m4-clinical-mcp.json +21 -0
- package/mcp-configs/academic-db/medical-mcp.json +21 -0
- package/mcp-configs/academic-db/nexonco-mcp.json +20 -0
- package/mcp-configs/academic-db/omop-mcp.json +20 -0
- package/mcp-configs/academic-db/onekgpd-mcp.json +20 -0
- package/mcp-configs/academic-db/openedu-mcp.json +20 -0
- package/mcp-configs/academic-db/opengenes-mcp.json +20 -0
- package/mcp-configs/academic-db/openstax-mcp.json +21 -0
- package/mcp-configs/academic-db/openstreetmap-mcp.json +21 -0
- package/mcp-configs/academic-db/opentargets-mcp.json +21 -0
- package/mcp-configs/academic-db/pdb-mcp.json +21 -0
- package/mcp-configs/academic-db/smithsonian-mcp.json +20 -0
- package/mcp-configs/ai-platform/magi-researchers.json +21 -0
- package/mcp-configs/ai-platform/mcp-academic-researcher.json +22 -0
- package/mcp-configs/ai-platform/open-paper-machine.json +21 -0
- package/mcp-configs/ai-platform/paper-intelligence.json +21 -0
- package/mcp-configs/ai-platform/paper-reader.json +21 -0
- package/mcp-configs/ai-platform/paperdebugger.json +21 -0
- package/mcp-configs/browser/exa-mcp.json +20 -0
- package/mcp-configs/browser/mcp-searxng.json +21 -0
- package/mcp-configs/browser/mcp-webresearch.json +20 -0
- package/mcp-configs/communication/discourse-mcp.json +21 -0
- package/mcp-configs/data-platform/automl-stat-mcp.json +21 -0
- package/mcp-configs/data-platform/jefferson-stats-mcp.json +22 -0
- package/mcp-configs/data-platform/mcp-excel-server.json +21 -0
- package/mcp-configs/data-platform/mcp-stata.json +21 -0
- package/mcp-configs/data-platform/mcpstack-jupyter.json +21 -0
- package/mcp-configs/data-platform/ml-mcp.json +21 -0
- package/mcp-configs/data-platform/nasdaq-data-link-mcp.json +20 -0
- package/mcp-configs/data-platform/numpy-mcp.json +21 -0
- package/mcp-configs/dev-platform/geogebra-mcp.json +21 -0
- package/mcp-configs/dev-platform/latex-mcp-server.json +21 -0
- package/mcp-configs/dev-platform/manim-mcp.json +20 -0
- package/mcp-configs/dev-platform/mcp-echarts.json +20 -0
- package/mcp-configs/dev-platform/panel-viz-mcp.json +20 -0
- package/mcp-configs/dev-platform/paperbanana.json +20 -0
- package/mcp-configs/dev-platform/texflow-mcp.json +20 -0
- package/mcp-configs/dev-platform/texmcp.json +20 -0
- package/mcp-configs/dev-platform/typst-mcp.json +21 -0
- package/mcp-configs/dev-platform/vizro-mcp.json +20 -0
- package/mcp-configs/note-knowledge/local-faiss-mcp.json +21 -0
- package/mcp-configs/note-knowledge/mcp-memory-service.json +21 -0
- package/mcp-configs/note-knowledge/mcp-obsidian.json +23 -0
- package/mcp-configs/note-knowledge/mcp-ragdocs.json +20 -0
- package/mcp-configs/note-knowledge/mcp-summarizer.json +21 -0
- package/mcp-configs/note-knowledge/mediawiki-mcp.json +21 -0
- package/mcp-configs/note-knowledge/openzim-mcp.json +20 -0
- package/mcp-configs/note-knowledge/zettelkasten-mcp.json +21 -0
- package/mcp-configs/reference-mgr/academic-paper-mcp-http.json +20 -0
- package/mcp-configs/reference-mgr/academix.json +20 -0
- package/mcp-configs/reference-mgr/arxiv-research-mcp.json +21 -0
- package/mcp-configs/reference-mgr/google-scholar-abstract-mcp.json +19 -0
- package/mcp-configs/reference-mgr/google-scholar-mcp.json +20 -0
- package/mcp-configs/reference-mgr/mcp-paperswithcode.json +21 -0
- package/mcp-configs/reference-mgr/mcp-scholarly.json +20 -0
- package/mcp-configs/reference-mgr/mcp-simple-arxiv.json +20 -0
- package/mcp-configs/reference-mgr/mcp-simple-pubmed.json +20 -0
- package/mcp-configs/reference-mgr/mcp-zotero.json +21 -0
- package/mcp-configs/reference-mgr/mendeley-mcp.json +20 -0
- package/mcp-configs/reference-mgr/ncbi-mcp-server.json +22 -0
- package/mcp-configs/reference-mgr/onecite.json +21 -0
- package/mcp-configs/reference-mgr/paper-search-mcp.json +21 -0
- package/mcp-configs/reference-mgr/pubmed-search-mcp.json +21 -0
- package/mcp-configs/reference-mgr/scholar-mcp.json +21 -0
- package/mcp-configs/reference-mgr/scholar-multi-mcp.json +21 -0
- package/mcp-configs/reference-mgr/seerai.json +21 -0
- package/mcp-configs/reference-mgr/semantic-scholar-fastmcp.json +21 -0
- package/mcp-configs/reference-mgr/sourcelibrary.json +20 -0
- package/openclaw.plugin.json +2 -2
- package/package.json +2 -2
- package/skills/analysis/dataviz/citation-map-guide/SKILL.md +184 -0
- package/skills/analysis/dataviz/data-visualization-principles/SKILL.md +171 -0
- package/skills/analysis/econometrics/econml-causal-guide/SKILL.md +2 -2
- package/skills/analysis/econometrics/empirical-paper-analysis/SKILL.md +192 -0
- package/skills/analysis/econometrics/mostly-harmless-guide/SKILL.md +2 -2
- package/skills/analysis/econometrics/panel-data-regression-workflow/SKILL.md +267 -0
- package/skills/analysis/econometrics/python-causality-guide/SKILL.md +2 -2
- package/skills/analysis/econometrics/stata-reference-guide/SKILL.md +293 -0
- package/skills/analysis/statistics/general-statistics-guide/SKILL.md +226 -0
- package/skills/analysis/statistics/infiagent-benchmark-guide/SKILL.md +106 -0
- package/skills/analysis/wrangling/claude-data-analysis-guide/SKILL.md +100 -0
- package/skills/analysis/wrangling/open-data-scientist-guide/SKILL.md +197 -0
- package/skills/analysis/wrangling/streamline-analyst-guide/SKILL.md +119 -0
- package/skills/domains/ai-ml/ai-agent-papers-guide/SKILL.md +146 -0
- package/skills/domains/ai-ml/anomaly-detection-papers-guide/SKILL.md +167 -0
- package/skills/domains/ai-ml/autonomous-agents-papers-guide/SKILL.md +178 -0
- package/skills/domains/ai-ml/domain-adaptation-papers-guide/SKILL.md +173 -0
- package/skills/domains/ai-ml/generative-ai-guide/SKILL.md +2 -2
- package/skills/domains/ai-ml/graph-learning-papers-guide/SKILL.md +125 -0
- package/skills/domains/ai-ml/kolmogorov-arnold-networks-guide/SKILL.md +185 -0
- package/skills/domains/ai-ml/npcpy-research-guide/SKILL.md +137 -0
- package/skills/domains/ai-ml/responsible-ai-guide/SKILL.md +126 -0
- package/skills/domains/ai-ml/vmas-simulator-guide/SKILL.md +129 -0
- package/skills/domains/biomedical/clawbio-guide/SKILL.md +167 -0
- package/skills/domains/biomedical/clinical-dialogue-agents-guide/SKILL.md +145 -0
- package/skills/domains/biomedical/ena-sequence-api/SKILL.md +175 -0
- package/skills/domains/biomedical/genomas-guide/SKILL.md +126 -0
- package/skills/domains/biomedical/genotex-benchmark-guide/SKILL.md +125 -0
- package/skills/domains/biomedical/med-researcher-guide/SKILL.md +161 -0
- package/skills/domains/biomedical/med-researcher-r1-guide/SKILL.md +146 -0
- package/skills/domains/biomedical/ncbi-blast-api/SKILL.md +195 -0
- package/skills/domains/biomedical/ncbi-datasets-api/SKILL.md +220 -0
- package/skills/domains/biomedical/quickgo-api/SKILL.md +181 -0
- package/skills/domains/business/xpert-bi-guide/SKILL.md +84 -0
- package/skills/domains/chemistry/cactus-cheminformatics-guide/SKILL.md +89 -0
- package/skills/domains/chemistry/chemeagle-guide/SKILL.md +147 -0
- package/skills/domains/chemistry/chemgraph-agent-guide/SKILL.md +120 -0
- package/skills/domains/cs/ai-security-papers-guide/SKILL.md +103 -0
- package/skills/domains/cs/code-llm-papers-guide/SKILL.md +131 -0
- package/skills/domains/cs/gaussian-splatting-papers-guide/SKILL.md +158 -0
- package/skills/domains/cs/llm-aiops-guide/SKILL.md +70 -0
- package/skills/domains/cs/software-heritage-api/SKILL.md +200 -0
- package/skills/domains/economics/nber-working-papers-api/SKILL.md +177 -0
- package/skills/domains/economics/repec-economics-api/SKILL.md +188 -0
- package/skills/domains/education/academic-study-methods/SKILL.md +228 -0
- package/skills/domains/education/edumcp-guide/SKILL.md +74 -0
- package/skills/domains/education/open-syllabus-api/SKILL.md +171 -0
- package/skills/domains/finance/akshare-finance-data/SKILL.md +207 -0
- package/skills/domains/finance/finsight-research-guide/SKILL.md +113 -0
- package/skills/domains/finance/options-analytics-agent-guide/SKILL.md +117 -0
- package/skills/domains/geoscience/pangaea-data-api/SKILL.md +197 -0
- package/skills/domains/humanities/digital-humanities-methods/SKILL.md +232 -0
- package/skills/domains/law/caselaw-access-api/SKILL.md +149 -0
- package/skills/domains/law/legal-agent-skills-guide/SKILL.md +132 -0
- package/skills/domains/law/legal-research-methods/SKILL.md +190 -0
- package/skills/domains/law/opencontracts-guide/SKILL.md +168 -0
- package/skills/domains/math/lean-theorem-proving-guide/SKILL.md +140 -0
- package/skills/domains/pharma/madd-drug-discovery-guide/SKILL.md +153 -0
- package/skills/domains/social-science/ipums-microdata-api/SKILL.md +211 -0
- package/skills/domains/social-science/sociology-research-methods/SKILL.md +181 -0
- package/skills/literature/discovery/arxiv-paper-monitoring/SKILL.md +233 -0
- package/skills/literature/discovery/papers-we-love-guide/SKILL.md +169 -0
- package/skills/literature/discovery/zotero-arxiv-daily-guide/SKILL.md +2 -2
- package/skills/literature/fulltext/bioc-pmc-api/SKILL.md +146 -0
- package/skills/literature/fulltext/dataverse-api/SKILL.md +215 -0
- package/skills/literature/fulltext/hal-archive-api/SKILL.md +218 -0
- package/skills/literature/fulltext/osf-api/SKILL.md +212 -0
- package/skills/literature/fulltext/pmc-ftp-bulk-download/SKILL.md +182 -0
- package/skills/literature/fulltext/zotero-ai-butler-guide/SKILL.md +166 -0
- package/skills/literature/fulltext/zotero-scihub-guide/SKILL.md +168 -0
- package/skills/literature/metadata/bibliometrix-guide/SKILL.md +164 -0
- package/skills/literature/metadata/crossref-event-data-api/SKILL.md +183 -0
- package/skills/literature/metadata/doi-content-negotiation/SKILL.md +202 -0
- package/skills/literature/metadata/orkg-api/SKILL.md +153 -0
- package/skills/literature/metadata/plumx-metrics-api/SKILL.md +188 -0
- package/skills/literature/metadata/ror-organization-api/SKILL.md +208 -0
- package/skills/literature/metadata/sophosia-reference-guide/SKILL.md +110 -0
- package/skills/literature/metadata/viaf-authority-api/SKILL.md +209 -0
- package/skills/literature/metadata/zoplicate-dedup-guide/SKILL.md +147 -0
- package/skills/literature/metadata/zotero-actions-tags-guide/SKILL.md +212 -0
- package/skills/literature/metadata/zotmoov-guide/SKILL.md +120 -0
- package/skills/literature/metadata/zutilo-guide/SKILL.md +140 -0
- package/skills/literature/search/arxiv-cli-tools/SKILL.md +172 -0
- package/skills/literature/search/arxiv-osiris/SKILL.md +199 -0
- package/skills/literature/search/base-academic-search/SKILL.md +196 -0
- package/skills/literature/search/chatpaper-guide/SKILL.md +2 -2
- package/skills/literature/search/citeseerx-api/SKILL.md +183 -0
- package/skills/literature/search/deepgit-search-guide/SKILL.md +2 -2
- package/skills/literature/search/eric-education-api/SKILL.md +199 -0
- package/skills/literature/search/findpapers-guide/SKILL.md +177 -0
- package/skills/literature/search/ieee-xplore-api/SKILL.md +177 -0
- package/skills/literature/search/lens-scholarly-api/SKILL.md +211 -0
- package/skills/literature/search/multi-database-literature-search/SKILL.md +198 -0
- package/skills/literature/search/open-library-api/SKILL.md +196 -0
- package/skills/literature/search/open-semantic-search-guide/SKILL.md +190 -0
- package/skills/literature/search/openaire-api/SKILL.md +141 -0
- package/skills/literature/search/paper-search-mcp-guide/SKILL.md +107 -0
- package/skills/literature/search/papers-chat-guide/SKILL.md +194 -0
- package/skills/literature/search/pasa-paper-search-guide/SKILL.md +2 -2
- package/skills/literature/search/plos-open-access-api/SKILL.md +203 -0
- package/skills/literature/search/scielo-api/SKILL.md +182 -0
- package/skills/literature/search/share-research-api/SKILL.md +129 -0
- package/skills/literature/search/worldcat-search-api/SKILL.md +224 -0
- package/skills/research/automation/aim-experiment-guide/SKILL.md +2 -2
- package/skills/research/automation/claude-academic-workflow-guide/SKILL.md +202 -0
- package/skills/research/automation/coexist-ai-guide/SKILL.md +149 -0
- package/skills/research/automation/datagen-research-guide/SKILL.md +2 -2
- package/skills/research/automation/foam-agent-guide/SKILL.md +203 -0
- package/skills/research/automation/kedro-pipeline-guide/SKILL.md +2 -2
- package/skills/research/automation/mle-agent-guide/SKILL.md +2 -2
- package/skills/research/automation/paper-to-agent-guide/SKILL.md +2 -2
- package/skills/research/deep-research/auto-deep-research-guide/SKILL.md +2 -2
- package/skills/research/deep-research/cognitive-kernel-guide/SKILL.md +200 -0
- package/skills/research/deep-research/corvus-research-guide/SKILL.md +132 -0
- package/skills/research/deep-research/in-depth-research-guide/SKILL.md +205 -0
- package/skills/research/deep-research/kosmos-scientist-guide/SKILL.md +185 -0
- package/skills/research/deep-research/llm-scientific-discovery-guide/SKILL.md +178 -0
- package/skills/research/deep-research/open-researcher-guide/SKILL.md +138 -0
- package/skills/research/methodology/claude-scientific-guide/SKILL.md +2 -2
- package/skills/research/methodology/parsifal-slr-guide/SKILL.md +154 -0
- package/skills/research/methodology/research-pipeline-units-guide/SKILL.md +169 -0
- package/skills/research/methodology/slr-automation-guide/SKILL.md +235 -0
- package/skills/research/paper-review/latte-review-guide/SKILL.md +175 -0
- package/skills/research/paper-review/paper-critique-framework/SKILL.md +181 -0
- package/skills/tools/code-exec/contextplus-mcp-guide/SKILL.md +110 -0
- package/skills/tools/diagram/clawphd-guide/SKILL.md +149 -0
- package/skills/tools/diagram/kroki-diagram-api/SKILL.md +198 -0
- package/skills/tools/diagram/scientific-graphical-abstract/SKILL.md +201 -0
- package/skills/tools/document/docsgpt-guide/SKILL.md +2 -2
- package/skills/tools/document/md2pdf-xelatex/SKILL.md +212 -0
- package/skills/tools/document/openpaper-guide/SKILL.md +232 -0
- package/skills/tools/document/weknora-guide/SKILL.md +216 -0
- package/skills/tools/document/zotero-addon-market-guide/SKILL.md +108 -0
- package/skills/tools/document/zotero-night-theme-guide/SKILL.md +142 -0
- package/skills/tools/document/zotero-style-guide/SKILL.md +217 -0
- package/skills/tools/knowledge-graph/graphiti-guide/SKILL.md +2 -2
- package/skills/tools/knowledge-graph/mimir-memory-guide/SKILL.md +135 -0
- package/skills/tools/knowledge-graph/notero-zotero-notion-guide/SKILL.md +187 -0
- package/skills/tools/knowledge-graph/open-webui-tools-guide/SKILL.md +156 -0
- package/skills/tools/knowledge-graph/openspg-guide/SKILL.md +210 -0
- package/skills/tools/knowledge-graph/paperpile-notion-guide/SKILL.md +84 -0
- package/skills/tools/knowledge-graph/zotero-markdb-connect-guide/SKILL.md +162 -0
- package/skills/tools/ocr-translate/latex-translation-guide/SKILL.md +176 -0
- package/skills/tools/ocr-translate/math-equation-renderer/SKILL.md +198 -0
- package/skills/tools/ocr-translate/pdf-math-translate-guide/SKILL.md +2 -2
- package/skills/tools/ocr-translate/zotero-pdf-translate-guide/SKILL.md +2 -2
- package/skills/tools/ocr-translate/zotero-pdf2zh-guide/SKILL.md +2 -2
- package/skills/writing/citation/academic-citation-manager-guide/SKILL.md +182 -0
- package/skills/writing/citation/citation-assistant-skill/SKILL.md +192 -0
- package/skills/writing/citation/jabref-reference-guide/SKILL.md +2 -2
- package/skills/writing/citation/jasminum-zotero-guide/SKILL.md +2 -2
- package/skills/writing/citation/mendeley-api/SKILL.md +231 -0
- package/skills/writing/citation/obsidian-citation-guide/SKILL.md +2 -2
- package/skills/writing/citation/obsidian-zotero-guide/SKILL.md +2 -2
- package/skills/writing/citation/onecite-reference-guide/SKILL.md +168 -0
- package/skills/writing/citation/papersgpt-zotero-guide/SKILL.md +2 -2
- package/skills/writing/citation/papis-cli-guide/SKILL.md +2 -2
- package/skills/writing/citation/zotero-better-bibtex-guide/SKILL.md +2 -2
- package/skills/writing/citation/zotero-better-notes-guide/SKILL.md +2 -2
- package/skills/writing/citation/zotero-gpt-guide/SKILL.md +2 -2
- package/skills/writing/citation/zotero-mcp-guide/SKILL.md +2 -2
- package/skills/writing/citation/zotero-mdnotes-guide/SKILL.md +2 -2
- package/skills/writing/citation/zotero-reference-guide/SKILL.md +2 -2
- package/skills/writing/citation/zotfile-attachment-guide/SKILL.md +2 -2
- package/skills/writing/composition/opendraft-thesis-guide/SKILL.md +200 -0
- package/skills/writing/composition/paper-debugger-guide/SKILL.md +2 -2
- package/skills/writing/composition/paperforge-guide/SKILL.md +205 -0
- package/skills/writing/composition/research-paper-writer/SKILL.md +226 -0
- package/skills/writing/composition/scientific-writing-resources/SKILL.md +2 -2
- package/skills/writing/latex/academic-writing-latex/SKILL.md +285 -0
- package/skills/writing/latex/latex-drawing-collection/SKILL.md +2 -2
- package/skills/writing/latex/latex-templates-collection/SKILL.md +2 -2
- package/skills/writing/polish/chinese-text-humanizer/SKILL.md +140 -0
- package/skills/writing/templates/arxiv-preprint-template/SKILL.md +184 -0
- package/skills/writing/templates/elegant-paper-template/SKILL.md +141 -0
- package/skills/writing/templates/novathesis-guide/SKILL.md +2 -2
- package/skills/writing/templates/sjtuthesis-guide/SKILL.md +2 -2
- package/skills/writing/templates/thuthesis-guide/SKILL.md +2 -2
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspg-guide
|
|
3
|
+
description: "Ant Group knowledge graph engine with SPG and KAG framework"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "🕸️"
|
|
7
|
+
category: "tools"
|
|
8
|
+
subcategory: "knowledge-graph"
|
|
9
|
+
keywords: ["OpenSPG", "knowledge graph", "SPG", "KAG", "Ant Group", "semantic reasoning"]
|
|
10
|
+
source: "https://github.com/OpenSPG/openspg"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# OpenSPG Knowledge Graph Guide
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
OpenSPG is Ant Group's open-source knowledge graph engine based on the Semantic-enhanced Programmable Graph (SPG) framework. It combines property graphs with semantic reasoning, enabling knowledge extraction, representation, reasoning, and question answering. The KAG (Knowledge Augmented Generation) module integrates with LLMs for RAG over knowledge graphs. Suited for building domain-specific knowledge bases for research.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Docker deployment
|
|
23
|
+
git clone https://github.com/OpenSPG/openspg.git
|
|
24
|
+
cd openspg
|
|
25
|
+
docker-compose up -d
|
|
26
|
+
|
|
27
|
+
# Python SDK
|
|
28
|
+
pip install openspg
|
|
29
|
+
|
|
30
|
+
# Access KG Studio at http://localhost:8887
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Core Concepts
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
SPG Framework
|
|
37
|
+
├── Schema Layer (define types and relations)
|
|
38
|
+
│ ├── Entity types (Person, Paper, Concept)
|
|
39
|
+
│ ├── Properties (typed, constrained)
|
|
40
|
+
│ └── Relations (directed, typed edges)
|
|
41
|
+
├── Knowledge Layer (populate with data)
|
|
42
|
+
│ ├── Entity extraction (NER + linking)
|
|
43
|
+
│ ├── Relation extraction
|
|
44
|
+
│ └── Property filling
|
|
45
|
+
├── Reasoning Layer (infer new knowledge)
|
|
46
|
+
│ ├── Rule-based reasoning
|
|
47
|
+
│ ├── Statistical reasoning
|
|
48
|
+
│ └── LLM-augmented reasoning
|
|
49
|
+
└── Application Layer (query and use)
|
|
50
|
+
├── Graph queries (SPARQL-like)
|
|
51
|
+
├── Question answering
|
|
52
|
+
└── Knowledge-augmented generation
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Schema Definition
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from openspg import Schema, EntityType, RelationType
|
|
59
|
+
|
|
60
|
+
# Define a research knowledge graph schema
|
|
61
|
+
schema = Schema("research_kg")
|
|
62
|
+
|
|
63
|
+
# Entity types
|
|
64
|
+
paper = EntityType("Paper", properties={
|
|
65
|
+
"title": "Text",
|
|
66
|
+
"abstract": "Text",
|
|
67
|
+
"year": "Integer",
|
|
68
|
+
"venue": "Text",
|
|
69
|
+
"doi": "Text",
|
|
70
|
+
"citation_count": "Integer",
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
author = EntityType("Author", properties={
|
|
74
|
+
"name": "Text",
|
|
75
|
+
"affiliation": "Text",
|
|
76
|
+
"h_index": "Integer",
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
concept = EntityType("Concept", properties={
|
|
80
|
+
"name": "Text",
|
|
81
|
+
"definition": "Text",
|
|
82
|
+
"domain": "Text",
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
# Relations
|
|
86
|
+
schema.add_relation(RelationType(
|
|
87
|
+
"authored_by", source=paper, target=author
|
|
88
|
+
))
|
|
89
|
+
schema.add_relation(RelationType(
|
|
90
|
+
"cites", source=paper, target=paper
|
|
91
|
+
))
|
|
92
|
+
schema.add_relation(RelationType(
|
|
93
|
+
"discusses", source=paper, target=concept
|
|
94
|
+
))
|
|
95
|
+
schema.add_relation(RelationType(
|
|
96
|
+
"related_to", source=concept, target=concept
|
|
97
|
+
))
|
|
98
|
+
|
|
99
|
+
schema.deploy()
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Knowledge Population
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
from openspg import KnowledgeBuilder
|
|
106
|
+
|
|
107
|
+
builder = KnowledgeBuilder(schema="research_kg")
|
|
108
|
+
|
|
109
|
+
# Add entities
|
|
110
|
+
builder.add_entity("Paper", {
|
|
111
|
+
"title": "Attention Is All You Need",
|
|
112
|
+
"year": 2017,
|
|
113
|
+
"venue": "NeurIPS",
|
|
114
|
+
"doi": "10.48550/arXiv.1706.03762",
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
# Automatic extraction from text
|
|
118
|
+
builder.extract_from_text(
|
|
119
|
+
"Vaswani et al. proposed the Transformer architecture "
|
|
120
|
+
"which uses self-attention mechanisms to replace "
|
|
121
|
+
"recurrence. The model achieved state-of-the-art on "
|
|
122
|
+
"WMT 2014 English-to-German translation.",
|
|
123
|
+
entity_types=["Paper", "Author", "Concept"],
|
|
124
|
+
relation_types=["authored_by", "discusses"],
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
# Batch import from structured data
|
|
128
|
+
builder.import_csv(
|
|
129
|
+
"papers.csv",
|
|
130
|
+
entity_type="Paper",
|
|
131
|
+
column_mapping={"title": "title", "year": "year"},
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
builder.commit()
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## KAG: Knowledge-Augmented Generation
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
from openspg.kag import KAGPipeline
|
|
141
|
+
|
|
142
|
+
kag = KAGPipeline(
|
|
143
|
+
knowledge_graph="research_kg",
|
|
144
|
+
llm_provider="anthropic",
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
# Question answering over knowledge graph
|
|
148
|
+
answer = kag.ask(
|
|
149
|
+
"What are the key papers on attention mechanisms "
|
|
150
|
+
"and how are they related?"
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
print(answer.text)
|
|
154
|
+
for source in answer.sources:
|
|
155
|
+
print(f" [{source.type}] {source.name}: {source.evidence}")
|
|
156
|
+
|
|
157
|
+
# The KAG pipeline:
|
|
158
|
+
# 1. Parses question to identify relevant entities/relations
|
|
159
|
+
# 2. Queries knowledge graph for subgraph
|
|
160
|
+
# 3. Augments LLM context with structured knowledge
|
|
161
|
+
# 4. Generates grounded answer with provenance
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Graph Queries
|
|
165
|
+
|
|
166
|
+
```python
|
|
167
|
+
from openspg import GraphQuery
|
|
168
|
+
|
|
169
|
+
gq = GraphQuery("research_kg")
|
|
170
|
+
|
|
171
|
+
# Find papers by concept
|
|
172
|
+
papers = gq.query("""
|
|
173
|
+
MATCH (p:Paper)-[:discusses]->(c:Concept)
|
|
174
|
+
WHERE c.name = 'self-attention'
|
|
175
|
+
RETURN p.title, p.year, p.citation_count
|
|
176
|
+
ORDER BY p.citation_count DESC
|
|
177
|
+
LIMIT 10
|
|
178
|
+
""")
|
|
179
|
+
|
|
180
|
+
# Find co-author network
|
|
181
|
+
coauthors = gq.query("""
|
|
182
|
+
MATCH (a1:Author)<-[:authored_by]-(p:Paper)
|
|
183
|
+
-[:authored_by]->(a2:Author)
|
|
184
|
+
WHERE a1.name = 'Ashish Vaswani'
|
|
185
|
+
RETURN DISTINCT a2.name, COUNT(p) as papers
|
|
186
|
+
ORDER BY papers DESC
|
|
187
|
+
""")
|
|
188
|
+
|
|
189
|
+
# Citation chain
|
|
190
|
+
chain = gq.query("""
|
|
191
|
+
MATCH path = (p1:Paper)-[:cites*1..3]->(p2:Paper)
|
|
192
|
+
WHERE p1.title CONTAINS 'GPT-4'
|
|
193
|
+
RETURN path
|
|
194
|
+
LIMIT 20
|
|
195
|
+
""")
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Use Cases
|
|
199
|
+
|
|
200
|
+
1. **Research KG**: Build knowledge graphs from paper collections
|
|
201
|
+
2. **Literature QA**: Grounded question answering over research
|
|
202
|
+
3. **Concept mapping**: Visualize research concept relationships
|
|
203
|
+
4. **Citation analysis**: Graph-based citation network analysis
|
|
204
|
+
5. **Domain ontology**: Build and maintain domain-specific schemas
|
|
205
|
+
|
|
206
|
+
## References
|
|
207
|
+
|
|
208
|
+
- [OpenSPG GitHub](https://github.com/OpenSPG/openspg)
|
|
209
|
+
- [KAG Framework](https://github.com/OpenSPG/KAG)
|
|
210
|
+
- [SPG White Paper](https://arxiv.org/abs/2302.09560)
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: paperpile-notion-guide
|
|
3
|
+
description: "Sync Paperpile references and annotations to Notion"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "📋"
|
|
7
|
+
category: "tools"
|
|
8
|
+
subcategory: "knowledge-graph"
|
|
9
|
+
keywords: ["Paperpile", "Notion", "sync", "reference management", "annotations", "integration"]
|
|
10
|
+
source: "https://github.com/gsarti/paperpile-notion"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Paperpile-Notion Integration Guide
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
Paperpile-Notion is a tool that syncs your Paperpile reference library to a Notion database. It exports paper metadata (title, authors, year, DOI, abstract), reading status, labels, and annotations to Notion pages, enabling you to combine reference management with Notion's rich knowledge management features.
|
|
18
|
+
|
|
19
|
+
## Setup
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Install from source
|
|
23
|
+
git clone https://github.com/gsarti/paperpile-notion.git
|
|
24
|
+
cd paperpile-notion
|
|
25
|
+
pip install -e .
|
|
26
|
+
|
|
27
|
+
# Configuration
|
|
28
|
+
# 1. Export Paperpile library as BibTeX/JSON
|
|
29
|
+
# 2. Create Notion integration and get token
|
|
30
|
+
# 3. Create Notion database with required properties
|
|
31
|
+
# 4. Run sync script
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Notion Database Properties
|
|
35
|
+
|
|
36
|
+
```markdown
|
|
37
|
+
### Required Properties
|
|
38
|
+
| Property | Type | Source |
|
|
39
|
+
|----------|------|--------|
|
|
40
|
+
| Title | Title | Paper title |
|
|
41
|
+
| Authors | Rich text | Author names |
|
|
42
|
+
| Year | Number | Publication year |
|
|
43
|
+
| DOI | URL | Digital Object Identifier |
|
|
44
|
+
| Abstract | Rich text | Paper abstract |
|
|
45
|
+
| Labels | Multi-select | Paperpile labels/folders |
|
|
46
|
+
| Status | Select | Read / Unread / Reading |
|
|
47
|
+
| Added | Date | Date added to Paperpile |
|
|
48
|
+
| Journal | Rich text | Publication venue |
|
|
49
|
+
| Notes | Rich text | Paperpile notes |
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Sync Workflow
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from paperpile_notion import PaperpileSync
|
|
56
|
+
|
|
57
|
+
sync = PaperpileSync(
|
|
58
|
+
paperpile_export="library.bib", # BibTeX export
|
|
59
|
+
notion_database_id="your_db_id",
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
# Full sync
|
|
63
|
+
result = sync.run()
|
|
64
|
+
print(f"Synced: {result.created} new, "
|
|
65
|
+
f"{result.updated} updated, "
|
|
66
|
+
f"{result.skipped} unchanged")
|
|
67
|
+
|
|
68
|
+
# Incremental sync (only new/modified)
|
|
69
|
+
result = sync.run(incremental=True)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Use Cases
|
|
73
|
+
|
|
74
|
+
1. **Knowledge management**: Paperpile references in Notion
|
|
75
|
+
2. **Reading tracking**: Kanban board for paper reading status
|
|
76
|
+
3. **Team collaboration**: Shared reference database in Notion
|
|
77
|
+
4. **Research notes**: Rich notes alongside paper metadata
|
|
78
|
+
5. **Project organization**: Tag papers by research project
|
|
79
|
+
|
|
80
|
+
## References
|
|
81
|
+
|
|
82
|
+
- [paperpile-notion GitHub](https://github.com/gsarti/paperpile-notion)
|
|
83
|
+
- [Paperpile](https://paperpile.com/)
|
|
84
|
+
- [Notion API](https://developers.notion.com/)
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: zotero-markdb-connect-guide
|
|
3
|
+
description: "Sync Zotero references to Obsidian and Logseq markdown"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "🔗"
|
|
7
|
+
category: "tools"
|
|
8
|
+
subcategory: "knowledge-graph"
|
|
9
|
+
keywords: ["Zotero", "Obsidian", "Logseq", "markdown", "PKM", "literature notes"]
|
|
10
|
+
source: "https://github.com/daeh/zotero-markdb-connect"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Zotero MarkDB-Connect Guide
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
Zotero MarkDB-Connect bridges Zotero with Markdown-based knowledge management tools (Obsidian, Logseq). It creates and maintains bidirectional links between Zotero items and their corresponding Markdown literature notes, enabling seamless navigation between your reference manager and PKM system. Syncs metadata, annotations, and tags.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Download .xpi from GitHub releases
|
|
23
|
+
# Zotero 7: Tools → Add-ons → Install Add-on From File
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Configuration
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
### Settings (Edit → Preferences → MarkDB-Connect)
|
|
30
|
+
|
|
31
|
+
**Markdown Vault Path:**
|
|
32
|
+
- Point to your Obsidian vault or Logseq directory
|
|
33
|
+
- Example: ~/Documents/ObsidianVault/Literature/
|
|
34
|
+
|
|
35
|
+
**Note Template:**
|
|
36
|
+
- Customize the Markdown template for new literature notes
|
|
37
|
+
- Uses Zotero item fields as variables
|
|
38
|
+
|
|
39
|
+
**Sync Options:**
|
|
40
|
+
- Auto-create notes for new items
|
|
41
|
+
- Sync annotations to Markdown
|
|
42
|
+
- Bidirectional tag sync
|
|
43
|
+
- Update existing notes on item change
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Note Template
|
|
47
|
+
|
|
48
|
+
```markdown
|
|
49
|
+
<!-- Template for literature notes -->
|
|
50
|
+
---
|
|
51
|
+
title: "{{title}}"
|
|
52
|
+
authors: [{{authors}}]
|
|
53
|
+
year: {{year}}
|
|
54
|
+
doi: {{doi}}
|
|
55
|
+
citekey: {{citekey}}
|
|
56
|
+
tags: [{{tags}}]
|
|
57
|
+
zotero: {{zoteroSelectURI}}
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
# {{title}}
|
|
61
|
+
|
|
62
|
+
**Authors:** {{authors}}
|
|
63
|
+
**Year:** {{year}}
|
|
64
|
+
**Venue:** {{publicationTitle}}
|
|
65
|
+
**DOI:** [{{doi}}](https://doi.org/{{doi}})
|
|
66
|
+
|
|
67
|
+
## Abstract
|
|
68
|
+
{{abstractNote}}
|
|
69
|
+
|
|
70
|
+
## Annotations
|
|
71
|
+
{{annotations}}
|
|
72
|
+
|
|
73
|
+
## Key Takeaways
|
|
74
|
+
-
|
|
75
|
+
|
|
76
|
+
## Notes
|
|
77
|
+
-
|
|
78
|
+
|
|
79
|
+
## Connections
|
|
80
|
+
- Related: [[]]
|
|
81
|
+
- Builds on: [[]]
|
|
82
|
+
- Contradicts: [[]]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Obsidian Integration
|
|
86
|
+
|
|
87
|
+
```markdown
|
|
88
|
+
### Folder Structure
|
|
89
|
+
ObsidianVault/
|
|
90
|
+
├── Literature/ # Auto-generated literature notes
|
|
91
|
+
│ ├── vaswani2017.md
|
|
92
|
+
│ ├── devlin2019.md
|
|
93
|
+
│ └── brown2020.md
|
|
94
|
+
├── Concepts/ # Your concept notes
|
|
95
|
+
│ ├── Attention.md # Links to [[vaswani2017]]
|
|
96
|
+
│ └── Pre-training.md # Links to [[devlin2019]]
|
|
97
|
+
└── Projects/ # Project notes referencing papers
|
|
98
|
+
|
|
99
|
+
### Workflow
|
|
100
|
+
1. Import paper in Zotero (via browser connector)
|
|
101
|
+
2. MarkDB-Connect auto-creates Literature/citekey.md
|
|
102
|
+
3. In Obsidian: open literature note, add your thoughts
|
|
103
|
+
4. Link to concept notes using [[wikilinks]]
|
|
104
|
+
5. Annotations sync from Zotero PDF reader
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Annotation Sync
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
### Zotero PDF Annotations → Markdown
|
|
111
|
+
|
|
112
|
+
When you highlight or annotate in Zotero's PDF reader:
|
|
113
|
+
|
|
114
|
+
> [!quote] Highlight (Yellow)
|
|
115
|
+
> "The attention mechanism allows focusing on relevant parts"
|
|
116
|
+
> — p. 3
|
|
117
|
+
|
|
118
|
+
> [!note] Note
|
|
119
|
+
> This is the key insight — attention replaces recurrence
|
|
120
|
+
> — p. 3, linked to highlight above
|
|
121
|
+
|
|
122
|
+
> [!important] Red Highlight
|
|
123
|
+
> "Our model achieves 28.4 BLEU on WMT 2014"
|
|
124
|
+
> — p. 7
|
|
125
|
+
|
|
126
|
+
Annotations auto-sync to the Markdown note when updated.
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Logseq Integration
|
|
130
|
+
|
|
131
|
+
```markdown
|
|
132
|
+
### Logseq-Specific Setup
|
|
133
|
+
- Set vault path to your Logseq pages directory
|
|
134
|
+
- Notes created as Logseq pages with properties block
|
|
135
|
+
- Uses Logseq property syntax instead of YAML frontmatter
|
|
136
|
+
|
|
137
|
+
### Logseq Note Format
|
|
138
|
+
title:: Attention Is All You Need
|
|
139
|
+
authors:: [[Vaswani]], [[Shazeer]]
|
|
140
|
+
year:: 2017
|
|
141
|
+
doi:: 10.48550/arXiv.1706.03762
|
|
142
|
+
tags:: #transformer #attention
|
|
143
|
+
zotero:: zotero://select/items/...
|
|
144
|
+
|
|
145
|
+
- Key contributions
|
|
146
|
+
- Self-attention mechanism replacing recurrence
|
|
147
|
+
- Multi-head attention for different representation subspaces
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Use Cases
|
|
151
|
+
|
|
152
|
+
1. **Literature management**: Seamless Zotero ↔ Obsidian workflow
|
|
153
|
+
2. **Knowledge building**: Link papers to concept notes
|
|
154
|
+
3. **Annotation workflow**: PDF annotations in Markdown
|
|
155
|
+
4. **Research writing**: Quick access to notes while writing
|
|
156
|
+
5. **Zettelkasten**: Literature notes as part of note network
|
|
157
|
+
|
|
158
|
+
## References
|
|
159
|
+
|
|
160
|
+
- [MarkDB-Connect GitHub](https://github.com/daeh/zotero-markdb-connect)
|
|
161
|
+
- [Obsidian](https://obsidian.md/)
|
|
162
|
+
- [Logseq](https://logseq.com/)
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: latex-translation-guide
|
|
3
|
+
description: "Translate LaTeX documents preserving math formulas and structure"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "🌐"
|
|
7
|
+
category: "tools"
|
|
8
|
+
subcategory: "ocr-translate"
|
|
9
|
+
keywords: ["LaTeX translation", "document translation", "multilingual", "math preservation", "academic translation"]
|
|
10
|
+
source: "https://github.com/SUSYUSTC/MathTranslate"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# LaTeX Document Translation Guide
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
Translating LaTeX academic documents requires preserving mathematical formulas, cross-references, citations, and formatting while converting the text between languages. This guide covers tools and techniques for translating LaTeX papers — from command-line utilities to full document pipelines. Particularly useful for making research accessible across language barriers.
|
|
18
|
+
|
|
19
|
+
## LaTeXTrans Approach
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Install LaTeXTrans
|
|
23
|
+
pip install latextrans
|
|
24
|
+
|
|
25
|
+
# Translate a LaTeX file
|
|
26
|
+
latextrans translate paper.tex --from en --to zh --output paper_zh.tex
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### How It Works
|
|
30
|
+
|
|
31
|
+
1. **Parse**: Extract text segments while preserving LaTeX commands
|
|
32
|
+
2. **Protect**: Shield math environments (`$...$`, `\[...\]`, equations)
|
|
33
|
+
3. **Translate**: Send text segments to translation API
|
|
34
|
+
4. **Reconstruct**: Reassemble with original LaTeX structure
|
|
35
|
+
|
|
36
|
+
### Python Usage
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from latextrans import LatexTranslator
|
|
40
|
+
|
|
41
|
+
translator = LatexTranslator(
|
|
42
|
+
source_lang="en",
|
|
43
|
+
target_lang="zh",
|
|
44
|
+
engine="google", # or "deepl", "openai"
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
# Translate a file
|
|
48
|
+
translator.translate_file("paper.tex", "paper_zh.tex")
|
|
49
|
+
|
|
50
|
+
# Translate a string
|
|
51
|
+
result = translator.translate(
|
|
52
|
+
r"The loss function $\mathcal{L}(\theta)$ is minimized "
|
|
53
|
+
r"using gradient descent with learning rate $\eta$."
|
|
54
|
+
)
|
|
55
|
+
# Output preserves $\mathcal{L}(\theta)$ and $\eta$ untouched
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## MathTranslate Tool
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Install MathTranslate (specialized for math-heavy papers)
|
|
62
|
+
pip install mathtranslate
|
|
63
|
+
|
|
64
|
+
# Translate arXiv paper directly
|
|
65
|
+
translate_arxiv 2301.00001 -o translated.tex
|
|
66
|
+
|
|
67
|
+
# Translate local file
|
|
68
|
+
translate_tex paper.tex -o paper_translated.tex
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### MathTranslate Features
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
# Configuration
|
|
75
|
+
import mathtranslate
|
|
76
|
+
|
|
77
|
+
# Set translation backend
|
|
78
|
+
mathtranslate.config.set_translator("google") # free
|
|
79
|
+
mathtranslate.config.set_translator("openai") # higher quality
|
|
80
|
+
|
|
81
|
+
# Translate with customization
|
|
82
|
+
mathtranslate.translate(
|
|
83
|
+
input_file="paper.tex",
|
|
84
|
+
output_file="paper_zh.tex",
|
|
85
|
+
source_lang="en",
|
|
86
|
+
target_lang="zh-CN",
|
|
87
|
+
threads=4, # parallel translation
|
|
88
|
+
)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Manual Translation Tips
|
|
92
|
+
|
|
93
|
+
### Protecting Math Environments
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
import re
|
|
97
|
+
|
|
98
|
+
def extract_and_protect(latex_text: str) -> tuple:
|
|
99
|
+
"""Extract math environments before translation."""
|
|
100
|
+
math_pattern = r'(\$\$[\s\S]*?\$\$|\$[^$]+\$|\\begin\{equation\}[\s\S]*?\\end\{equation\}|\\begin\{align\}[\s\S]*?\\end\{align\})'
|
|
101
|
+
|
|
102
|
+
placeholders = {}
|
|
103
|
+
counter = [0]
|
|
104
|
+
|
|
105
|
+
def replace_math(match):
|
|
106
|
+
key = f"__MATH_{counter[0]}__"
|
|
107
|
+
placeholders[key] = match.group(0)
|
|
108
|
+
counter[0] += 1
|
|
109
|
+
return key
|
|
110
|
+
|
|
111
|
+
protected = re.sub(math_pattern, replace_math, latex_text)
|
|
112
|
+
return protected, placeholders
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def restore_math(translated: str, placeholders: dict) -> str:
|
|
116
|
+
"""Restore math environments after translation."""
|
|
117
|
+
for key, value in placeholders.items():
|
|
118
|
+
translated = translated.replace(key, value)
|
|
119
|
+
return translated
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Commands to Protect
|
|
123
|
+
|
|
124
|
+
```latex
|
|
125
|
+
% Always protect these:
|
|
126
|
+
\ref{...} % Cross-references
|
|
127
|
+
\cite{...} % Citations
|
|
128
|
+
\label{...} % Labels
|
|
129
|
+
\eqref{...} % Equation references
|
|
130
|
+
\url{...} % URLs
|
|
131
|
+
\texttt{...} % Code/monospace
|
|
132
|
+
|
|
133
|
+
% Math environments to protect:
|
|
134
|
+
$...$ % Inline math
|
|
135
|
+
$$...$$ % Display math
|
|
136
|
+
\[...\] % Display math
|
|
137
|
+
\begin{equation}...\end{equation}
|
|
138
|
+
\begin{align}...\end{align}
|
|
139
|
+
\begin{theorem}...\end{theorem} % Custom environments
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Bilingual Output
|
|
143
|
+
|
|
144
|
+
```latex
|
|
145
|
+
% Create side-by-side bilingual document
|
|
146
|
+
\usepackage{paracol}
|
|
147
|
+
|
|
148
|
+
\begin{paracol}{2}
|
|
149
|
+
\switchcolumn[0]
|
|
150
|
+
The transformer architecture has become...
|
|
151
|
+
|
|
152
|
+
\switchcolumn[1]
|
|
153
|
+
Transformer架构已经成为...
|
|
154
|
+
|
|
155
|
+
\switchcolumn[0]
|
|
156
|
+
Self-attention computes $\text{Attention}(Q,K,V) = \text{softmax}(\frac{QK^T}{\sqrt{d_k}})V$
|
|
157
|
+
|
|
158
|
+
\switchcolumn[1]
|
|
159
|
+
自注意力计算 $\text{Attention}(Q,K,V) = \text{softmax}(\frac{QK^T}{\sqrt{d_k}})V$
|
|
160
|
+
\end{paracol}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Translation Backends
|
|
164
|
+
|
|
165
|
+
| Backend | Quality | Cost | Speed |
|
|
166
|
+
|---------|---------|------|-------|
|
|
167
|
+
| Google Translate | Good | Free | Fast |
|
|
168
|
+
| DeepL | Better | Freemium | Fast |
|
|
169
|
+
| OpenAI GPT-4 | Best | Paid | Slower |
|
|
170
|
+
| Claude | Best | Paid | Slower |
|
|
171
|
+
|
|
172
|
+
## References
|
|
173
|
+
|
|
174
|
+
- [LaTeXTrans](https://github.com/SUSYUSTC/MathTranslate)
|
|
175
|
+
- [PDFMathTranslate](https://github.com/Byaidu/PDFMathTranslate)
|
|
176
|
+
- [arXiv LaTeX Cleaner](https://github.com/google-research/arxiv-latex-cleaner)
|