@wentorai/research-plugins 1.0.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 +22 -22
- package/curated/analysis/README.md +82 -56
- package/curated/domains/README.md +225 -69
- package/curated/literature/README.md +115 -46
- package/curated/research/README.md +106 -58
- package/curated/tools/README.md +107 -87
- package/curated/writing/README.md +92 -45
- 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/cloud-docs/confluence-mcp.json +37 -0
- package/mcp-configs/cloud-docs/google-drive-mcp.json +35 -0
- package/mcp-configs/cloud-docs/notion-mcp.json +29 -0
- package/mcp-configs/communication/discord-mcp.json +29 -0
- package/mcp-configs/communication/discourse-mcp.json +21 -0
- package/mcp-configs/communication/slack-mcp.json +29 -0
- package/mcp-configs/communication/telegram-mcp.json +28 -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/database/neo4j-mcp.json +37 -0
- package/mcp-configs/database/postgres-mcp.json +28 -0
- package/mcp-configs/database/sqlite-mcp.json +29 -0
- package/mcp-configs/dev-platform/geogebra-mcp.json +21 -0
- package/mcp-configs/dev-platform/github-mcp.json +31 -0
- package/mcp-configs/dev-platform/gitlab-mcp.json +34 -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/email/email-mcp.json +40 -0
- package/mcp-configs/email/gmail-mcp.json +37 -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/mcp-configs/registry.json +178 -149
- package/mcp-configs/repository/dataverse-mcp.json +33 -0
- package/mcp-configs/repository/huggingface-mcp.json +29 -0
- package/openclaw.plugin.json +2 -2
- package/package.json +2 -2
- package/skills/analysis/dataviz/algorithm-visualizer-guide/SKILL.md +259 -0
- package/skills/analysis/dataviz/bokeh-visualization-guide/SKILL.md +270 -0
- package/skills/analysis/dataviz/chart-image-generator/SKILL.md +229 -0
- package/skills/analysis/dataviz/citation-map-guide/SKILL.md +184 -0
- package/skills/analysis/dataviz/d3-visualization-guide/SKILL.md +281 -0
- package/skills/analysis/dataviz/data-visualization-principles/SKILL.md +171 -0
- package/skills/analysis/dataviz/echarts-visualization-guide/SKILL.md +250 -0
- package/skills/analysis/dataviz/metabase-analytics-guide/SKILL.md +242 -0
- package/skills/analysis/dataviz/plotly-interactive-guide/SKILL.md +266 -0
- package/skills/analysis/dataviz/redash-analytics-guide/SKILL.md +284 -0
- package/skills/analysis/econometrics/econml-causal-guide/SKILL.md +163 -0
- package/skills/analysis/econometrics/empirical-paper-analysis/SKILL.md +192 -0
- package/skills/analysis/econometrics/mostly-harmless-guide/SKILL.md +139 -0
- package/skills/analysis/econometrics/panel-data-analyst/SKILL.md +259 -0
- package/skills/analysis/econometrics/panel-data-regression-workflow/SKILL.md +267 -0
- package/skills/analysis/econometrics/python-causality-guide/SKILL.md +134 -0
- package/skills/analysis/econometrics/stata-accounting-guide/SKILL.md +269 -0
- package/skills/analysis/econometrics/stata-analyst-guide/SKILL.md +245 -0
- package/skills/analysis/econometrics/stata-reference-guide/SKILL.md +293 -0
- package/skills/analysis/statistics/data-anomaly-detection/SKILL.md +157 -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/statistics/ml-experiment-tracker/SKILL.md +212 -0
- package/skills/analysis/statistics/pywayne-statistics-guide/SKILL.md +192 -0
- package/skills/analysis/statistics/quantitative-methods-guide/SKILL.md +193 -0
- package/skills/analysis/statistics/senior-data-scientist-guide/SKILL.md +223 -0
- package/skills/analysis/wrangling/claude-data-analysis-guide/SKILL.md +100 -0
- package/skills/analysis/wrangling/csv-data-analyzer/SKILL.md +170 -0
- package/skills/analysis/wrangling/data-cleaning-pipeline/SKILL.md +266 -0
- package/skills/analysis/wrangling/data-cog-guide/SKILL.md +178 -0
- package/skills/analysis/wrangling/open-data-scientist-guide/SKILL.md +197 -0
- package/skills/analysis/wrangling/stata-data-cleaning/SKILL.md +276 -0
- package/skills/analysis/wrangling/streamline-analyst-guide/SKILL.md +119 -0
- package/skills/analysis/wrangling/survey-data-processing/SKILL.md +298 -0
- package/skills/domains/ai-ml/ai-agent-papers-guide/SKILL.md +146 -0
- package/skills/domains/ai-ml/ai-model-benchmarking/SKILL.md +209 -0
- package/skills/domains/ai-ml/annotated-dl-papers-guide/SKILL.md +159 -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/dl-transformer-finetune/SKILL.md +239 -0
- package/skills/domains/ai-ml/domain-adaptation-papers-guide/SKILL.md +173 -0
- package/skills/domains/ai-ml/generative-ai-guide/SKILL.md +146 -0
- package/skills/domains/ai-ml/graph-learning-papers-guide/SKILL.md +125 -0
- package/skills/domains/ai-ml/huggingface-inference-guide/SKILL.md +196 -0
- package/skills/domains/ai-ml/keras-deep-learning/SKILL.md +210 -0
- package/skills/domains/ai-ml/kolmogorov-arnold-networks-guide/SKILL.md +185 -0
- package/skills/domains/ai-ml/llm-from-scratch-guide/SKILL.md +124 -0
- package/skills/domains/ai-ml/ml-pipeline-guide/SKILL.md +295 -0
- package/skills/domains/ai-ml/nlp-toolkit-guide/SKILL.md +247 -0
- package/skills/domains/ai-ml/npcpy-research-guide/SKILL.md +137 -0
- package/skills/domains/ai-ml/pytorch-guide/SKILL.md +281 -0
- package/skills/domains/ai-ml/pytorch-lightning-guide/SKILL.md +244 -0
- package/skills/domains/ai-ml/responsible-ai-guide/SKILL.md +126 -0
- package/skills/domains/ai-ml/tensorflow-guide/SKILL.md +241 -0
- package/skills/domains/ai-ml/vmas-simulator-guide/SKILL.md +129 -0
- package/skills/domains/biomedical/bioagents-guide/SKILL.md +308 -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/medgeclaw-guide/SKILL.md +345 -0
- package/skills/domains/biomedical/medical-imaging-guide/SKILL.md +305 -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/architecture-design-guide/SKILL.md +279 -0
- package/skills/domains/business/innovation-management-guide/SKILL.md +257 -0
- package/skills/domains/business/operations-research-guide/SKILL.md +258 -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/chemistry/molecular-dynamics-guide/SKILL.md +237 -0
- package/skills/domains/chemistry/pubchem-api-guide/SKILL.md +180 -0
- package/skills/domains/chemistry/spectroscopy-analysis-guide/SKILL.md +290 -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/distributed-systems-guide/SKILL.md +268 -0
- package/skills/domains/cs/formal-verification-guide/SKILL.md +298 -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/ecology/species-distribution-guide/SKILL.md +343 -0
- package/skills/domains/economics/imf-data-api-guide/SKILL.md +174 -0
- package/skills/domains/economics/nber-working-papers-api/SKILL.md +177 -0
- package/skills/domains/economics/post-labor-economics/SKILL.md +254 -0
- package/skills/domains/economics/pricing-psychology-guide/SKILL.md +273 -0
- package/skills/domains/economics/repec-economics-api/SKILL.md +188 -0
- package/skills/domains/economics/world-bank-data-guide/SKILL.md +179 -0
- package/skills/domains/education/academic-study-methods/SKILL.md +228 -0
- package/skills/domains/education/assessment-design-guide/SKILL.md +213 -0
- package/skills/domains/education/educational-research-methods/SKILL.md +179 -0
- package/skills/domains/education/edumcp-guide/SKILL.md +74 -0
- package/skills/domains/education/mooc-analytics-guide/SKILL.md +206 -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/finance/portfolio-optimization-guide/SKILL.md +279 -0
- package/skills/domains/finance/risk-modeling-guide/SKILL.md +260 -0
- package/skills/domains/finance/stata-accounting-research/SKILL.md +372 -0
- package/skills/domains/geoscience/climate-modeling-guide/SKILL.md +215 -0
- package/skills/domains/geoscience/pangaea-data-api/SKILL.md +197 -0
- package/skills/domains/geoscience/satellite-remote-sensing/SKILL.md +193 -0
- package/skills/domains/geoscience/seismology-data-guide/SKILL.md +208 -0
- package/skills/domains/humanities/digital-humanities-methods/SKILL.md +232 -0
- package/skills/domains/humanities/ethical-philosophy-guide/SKILL.md +244 -0
- package/skills/domains/humanities/history-research-guide/SKILL.md +260 -0
- package/skills/domains/humanities/political-history-guide/SKILL.md +241 -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-nlp-guide/SKILL.md +236 -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/law/patent-analysis-guide/SKILL.md +257 -0
- package/skills/domains/law/regulatory-compliance-guide/SKILL.md +267 -0
- package/skills/domains/math/lean-theorem-proving-guide/SKILL.md +140 -0
- package/skills/domains/math/symbolic-computation-guide/SKILL.md +263 -0
- package/skills/domains/math/topology-data-analysis/SKILL.md +305 -0
- package/skills/domains/pharma/clinical-trial-design-guide/SKILL.md +271 -0
- package/skills/domains/pharma/drug-target-interaction/SKILL.md +242 -0
- package/skills/domains/pharma/madd-drug-discovery-guide/SKILL.md +153 -0
- package/skills/domains/pharma/pharmacovigilance-guide/SKILL.md +216 -0
- package/skills/domains/physics/astrophysics-data-guide/SKILL.md +305 -0
- package/skills/domains/physics/particle-physics-guide/SKILL.md +287 -0
- package/skills/domains/social-science/ipums-microdata-api/SKILL.md +211 -0
- package/skills/domains/social-science/network-analysis-guide/SKILL.md +310 -0
- package/skills/domains/social-science/psychology-research-guide/SKILL.md +270 -0
- package/skills/domains/social-science/sociology-research-guide/SKILL.md +238 -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/paper-recommendation-guide/SKILL.md +120 -0
- package/skills/literature/discovery/papers-we-love-guide/SKILL.md +169 -0
- package/skills/literature/discovery/semantic-paper-radar/SKILL.md +144 -0
- package/skills/literature/discovery/zotero-arxiv-daily-guide/SKILL.md +94 -0
- package/skills/literature/fulltext/bioc-pmc-api/SKILL.md +146 -0
- package/skills/literature/fulltext/core-api-guide/SKILL.md +144 -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/institutional-repository-guide/SKILL.md +212 -0
- package/skills/literature/fulltext/open-access-mining-guide/SKILL.md +341 -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/academic-paper-summarizer/SKILL.md +101 -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/wikidata-api-guide/SKILL.md +156 -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-batch-reporting/SKILL.md +133 -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/arxiv-paper-processor/SKILL.md +141 -0
- package/skills/literature/search/baidu-scholar-guide/SKILL.md +110 -0
- package/skills/literature/search/base-academic-search/SKILL.md +196 -0
- package/skills/literature/search/chatpaper-guide/SKILL.md +122 -0
- package/skills/literature/search/citeseerx-api/SKILL.md +183 -0
- package/skills/literature/search/deep-literature-search/SKILL.md +149 -0
- package/skills/literature/search/deepgit-search-guide/SKILL.md +147 -0
- 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 +138 -0
- 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/ai-scientist-v2-guide/SKILL.md +284 -0
- package/skills/research/automation/aim-experiment-guide/SKILL.md +234 -0
- 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 +131 -0
- package/skills/research/automation/foam-agent-guide/SKILL.md +203 -0
- package/skills/research/automation/kedro-pipeline-guide/SKILL.md +216 -0
- package/skills/research/automation/mle-agent-guide/SKILL.md +139 -0
- package/skills/research/automation/paper-to-agent-guide/SKILL.md +116 -0
- package/skills/research/automation/rd-agent-guide/SKILL.md +246 -0
- package/skills/research/automation/research-paper-orchestrator/SKILL.md +254 -0
- package/skills/research/deep-research/academic-deep-research/SKILL.md +190 -0
- package/skills/research/deep-research/auto-deep-research-guide/SKILL.md +141 -0
- 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/deep-research-pro/SKILL.md +213 -0
- package/skills/research/deep-research/deep-research-work/SKILL.md +204 -0
- package/skills/research/deep-research/deep-searcher-guide/SKILL.md +253 -0
- package/skills/research/deep-research/gpt-researcher-guide/SKILL.md +191 -0
- package/skills/research/deep-research/in-depth-research-guide/SKILL.md +205 -0
- package/skills/research/deep-research/khoj-research-guide/SKILL.md +200 -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/local-deep-research-guide/SKILL.md +253 -0
- package/skills/research/deep-research/open-researcher-guide/SKILL.md +138 -0
- package/skills/research/deep-research/tongyi-deep-research-guide/SKILL.md +217 -0
- package/skills/research/funding/eu-horizon-guide/SKILL.md +244 -0
- package/skills/research/funding/grant-budget-guide/SKILL.md +284 -0
- package/skills/research/funding/nih-reporter-api-guide/SKILL.md +166 -0
- package/skills/research/funding/nsf-award-api-guide/SKILL.md +133 -0
- package/skills/research/methodology/academic-mentor-guide/SKILL.md +169 -0
- package/skills/research/methodology/claude-scientific-guide/SKILL.md +122 -0
- package/skills/research/methodology/deep-innovator-guide/SKILL.md +242 -0
- package/skills/research/methodology/osf-api-guide/SKILL.md +165 -0
- package/skills/research/methodology/parsifal-slr-guide/SKILL.md +154 -0
- package/skills/research/methodology/research-paper-kb/SKILL.md +263 -0
- package/skills/research/methodology/research-pipeline-units-guide/SKILL.md +169 -0
- package/skills/research/methodology/research-town-guide/SKILL.md +263 -0
- package/skills/research/methodology/slr-automation-guide/SKILL.md +235 -0
- package/skills/research/paper-review/automated-review-guide/SKILL.md +281 -0
- package/skills/research/paper-review/latte-review-guide/SKILL.md +175 -0
- package/skills/research/paper-review/paper-compare-guide/SKILL.md +238 -0
- package/skills/research/paper-review/paper-critique-framework/SKILL.md +181 -0
- package/skills/research/paper-review/paper-digest-guide/SKILL.md +240 -0
- package/skills/research/paper-review/paper-research-assistant/SKILL.md +231 -0
- package/skills/research/paper-review/research-quality-filter/SKILL.md +261 -0
- package/skills/research/paper-review/review-response-guide/SKILL.md +275 -0
- package/skills/tools/code-exec/contextplus-mcp-guide/SKILL.md +110 -0
- package/skills/tools/code-exec/google-colab-guide/SKILL.md +276 -0
- package/skills/tools/code-exec/kaggle-api-guide/SKILL.md +216 -0
- package/skills/tools/code-exec/overleaf-cli-guide/SKILL.md +279 -0
- package/skills/tools/diagram/clawphd-guide/SKILL.md +149 -0
- package/skills/tools/diagram/code-flow-visualizer/SKILL.md +197 -0
- package/skills/tools/diagram/excalidraw-diagram-guide/SKILL.md +170 -0
- package/skills/tools/diagram/json-data-visualizer/SKILL.md +270 -0
- package/skills/tools/diagram/kroki-diagram-api/SKILL.md +198 -0
- package/skills/tools/diagram/mermaid-architect-guide/SKILL.md +219 -0
- package/skills/tools/diagram/scientific-graphical-abstract/SKILL.md +201 -0
- package/skills/tools/diagram/tldraw-whiteboard-guide/SKILL.md +397 -0
- package/skills/tools/document/docsgpt-guide/SKILL.md +130 -0
- package/skills/tools/document/large-document-reader/SKILL.md +202 -0
- package/skills/tools/document/md2pdf-xelatex/SKILL.md +212 -0
- package/skills/tools/document/openpaper-guide/SKILL.md +232 -0
- package/skills/tools/document/paper-parse-guide/SKILL.md +243 -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/citation-network-builder/SKILL.md +244 -0
- package/skills/tools/knowledge-graph/concept-map-generator/SKILL.md +284 -0
- package/skills/tools/knowledge-graph/graphiti-guide/SKILL.md +219 -0
- 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 +141 -0
- package/skills/tools/ocr-translate/zotero-pdf-translate-guide/SKILL.md +95 -0
- package/skills/tools/ocr-translate/zotero-pdf2zh-guide/SKILL.md +143 -0
- package/skills/tools/scraping/dataset-finder-guide/SKILL.md +253 -0
- package/skills/tools/scraping/easy-spider-guide/SKILL.md +250 -0
- package/skills/tools/scraping/google-scholar-scraper/SKILL.md +255 -0
- package/skills/tools/scraping/repository-harvesting-guide/SKILL.md +310 -0
- package/skills/writing/citation/academic-citation-manager/SKILL.md +314 -0
- 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 +127 -0
- package/skills/writing/citation/jasminum-zotero-guide/SKILL.md +103 -0
- package/skills/writing/citation/mendeley-api/SKILL.md +231 -0
- package/skills/writing/citation/obsidian-citation-guide/SKILL.md +164 -0
- package/skills/writing/citation/obsidian-zotero-guide/SKILL.md +137 -0
- package/skills/writing/citation/onecite-reference-guide/SKILL.md +168 -0
- package/skills/writing/citation/papersgpt-zotero-guide/SKILL.md +132 -0
- package/skills/writing/citation/papis-cli-guide/SKILL.md +213 -0
- package/skills/writing/citation/zotero-better-bibtex-guide/SKILL.md +107 -0
- package/skills/writing/citation/zotero-better-notes-guide/SKILL.md +121 -0
- package/skills/writing/citation/zotero-gpt-guide/SKILL.md +111 -0
- package/skills/writing/citation/zotero-mcp-guide/SKILL.md +164 -0
- package/skills/writing/citation/zotero-mdnotes-guide/SKILL.md +162 -0
- package/skills/writing/citation/zotero-reference-guide/SKILL.md +139 -0
- package/skills/writing/citation/zotero-scholar-guide/SKILL.md +294 -0
- package/skills/writing/citation/zotfile-attachment-guide/SKILL.md +140 -0
- package/skills/writing/composition/ml-paper-writing/SKILL.md +163 -0
- package/skills/writing/composition/opendraft-thesis-guide/SKILL.md +200 -0
- package/skills/writing/composition/paper-debugger-guide/SKILL.md +143 -0
- 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 +151 -0
- package/skills/writing/composition/scientific-writing-wrapper/SKILL.md +153 -0
- package/skills/writing/latex/academic-writing-latex/SKILL.md +285 -0
- package/skills/writing/latex/latex-drawing-collection/SKILL.md +154 -0
- package/skills/writing/latex/latex-templates-collection/SKILL.md +159 -0
- package/skills/writing/latex/md-to-pdf-academic/SKILL.md +230 -0
- package/skills/writing/latex/tex-render-guide/SKILL.md +243 -0
- package/skills/writing/polish/academic-tone-guide/SKILL.md +209 -0
- package/skills/writing/polish/chinese-text-humanizer/SKILL.md +140 -0
- package/skills/writing/polish/conciseness-editing-guide/SKILL.md +225 -0
- package/skills/writing/polish/paper-polish-guide/SKILL.md +160 -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/graphical-abstract-guide/SKILL.md +183 -0
- package/skills/writing/templates/novathesis-guide/SKILL.md +152 -0
- package/skills/writing/templates/scientific-article-pdf/SKILL.md +261 -0
- package/skills/writing/templates/sjtuthesis-guide/SKILL.md +197 -0
- package/skills/writing/templates/thuthesis-guide/SKILL.md +181 -0
- package/skills/literature/fulltext/repository-harvesting-guide/SKILL.md +0 -207
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nlp-toolkit-guide
|
|
3
|
+
description: "NLP analysis with perplexity scoring, burstiness, and entropy metrics"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "💬"
|
|
7
|
+
category: "domains"
|
|
8
|
+
subcategory: "ai-ml"
|
|
9
|
+
keywords: ["NLP", "perplexity", "burstiness", "entropy", "tokenization", "text analysis"]
|
|
10
|
+
source: "https://github.com/huggingface/transformers"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# NLP Toolkit Guide
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
Natural Language Processing research requires a diverse set of analytical tools beyond standard model training. Text quality assessment, AI-generated text detection, linguistic feature extraction, and corpus analysis all depend on well-understood metrics: perplexity, burstiness, entropy, and their variants.
|
|
18
|
+
|
|
19
|
+
This guide provides practical implementations of these core NLP metrics alongside patterns for tokenization, embedding analysis, and text feature engineering. The focus is on metrics used in active research areas -- AI text detection (perplexity + burstiness classifiers), information-theoretic analysis of corpora, and linguistic diversity measurement.
|
|
20
|
+
|
|
21
|
+
These tools are framework-agnostic where possible, but leverage Hugging Face Transformers for language model operations and standard Python scientific computing libraries for statistical analysis.
|
|
22
|
+
|
|
23
|
+
## Perplexity Scoring
|
|
24
|
+
|
|
25
|
+
Perplexity measures how well a language model predicts a text. Lower perplexity means the text is more predictable to the model -- a key signal in AI text detection, model evaluation, and domain adaptation.
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
import torch
|
|
29
|
+
import numpy as np
|
|
30
|
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
31
|
+
|
|
32
|
+
def compute_perplexity(text: str, model_name: str = "gpt2") -> dict:
|
|
33
|
+
"""
|
|
34
|
+
Compute token-level and text-level perplexity using a causal LM.
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
dict with 'perplexity', 'log_likelihood', 'token_perplexities'
|
|
38
|
+
"""
|
|
39
|
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
40
|
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
|
41
|
+
model.eval()
|
|
42
|
+
|
|
43
|
+
encodings = tokenizer(text, return_tensors="pt", truncation=True, max_length=1024)
|
|
44
|
+
input_ids = encodings.input_ids
|
|
45
|
+
|
|
46
|
+
with torch.no_grad():
|
|
47
|
+
outputs = model(input_ids, labels=input_ids)
|
|
48
|
+
neg_log_likelihood = outputs.loss.item()
|
|
49
|
+
|
|
50
|
+
# Token-level perplexities for analysis
|
|
51
|
+
with torch.no_grad():
|
|
52
|
+
logits = outputs.logits[:, :-1, :] # Shift for next-token prediction
|
|
53
|
+
targets = input_ids[:, 1:]
|
|
54
|
+
log_probs = torch.log_softmax(logits, dim=-1)
|
|
55
|
+
token_log_probs = log_probs.gather(2, targets.unsqueeze(-1)).squeeze(-1)
|
|
56
|
+
token_perplexities = torch.exp(-token_log_probs).squeeze().tolist()
|
|
57
|
+
|
|
58
|
+
perplexity = np.exp(neg_log_likelihood)
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
"perplexity": perplexity,
|
|
62
|
+
"log_likelihood": -neg_log_likelihood,
|
|
63
|
+
"token_perplexities": token_perplexities,
|
|
64
|
+
"num_tokens": input_ids.size(1),
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Burstiness Analysis
|
|
69
|
+
|
|
70
|
+
Burstiness measures the tendency of words to appear in clusters rather than uniformly across a text. Human writing tends to be "burstier" -- once a topic is introduced, related terms cluster together, then disappear.
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
from collections import Counter
|
|
74
|
+
import numpy as np
|
|
75
|
+
|
|
76
|
+
def compute_burstiness(text: str, min_freq: int = 2) -> dict:
|
|
77
|
+
"""
|
|
78
|
+
Compute burstiness score for a text.
|
|
79
|
+
|
|
80
|
+
Burstiness B = (sigma - mu) / (sigma + mu)
|
|
81
|
+
where sigma and mu are the std dev and mean of inter-arrival times.
|
|
82
|
+
B ranges from -1 (periodic) to 1 (bursty). Human text typically B > 0.
|
|
83
|
+
"""
|
|
84
|
+
words = text.lower().split()
|
|
85
|
+
word_positions = {}
|
|
86
|
+
for i, word in enumerate(words):
|
|
87
|
+
word_positions.setdefault(word, []).append(i)
|
|
88
|
+
|
|
89
|
+
burstiness_scores = {}
|
|
90
|
+
for word, positions in word_positions.items():
|
|
91
|
+
if len(positions) < min_freq:
|
|
92
|
+
continue
|
|
93
|
+
inter_arrivals = np.diff(positions)
|
|
94
|
+
mu = np.mean(inter_arrivals)
|
|
95
|
+
sigma = np.std(inter_arrivals)
|
|
96
|
+
if mu + sigma == 0:
|
|
97
|
+
burstiness_scores[word] = 0.0
|
|
98
|
+
else:
|
|
99
|
+
burstiness_scores[word] = (sigma - mu) / (sigma + mu)
|
|
100
|
+
|
|
101
|
+
# Aggregate burstiness
|
|
102
|
+
if burstiness_scores:
|
|
103
|
+
avg_burstiness = np.mean(list(burstiness_scores.values()))
|
|
104
|
+
else:
|
|
105
|
+
avg_burstiness = 0.0
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
"average_burstiness": avg_burstiness,
|
|
109
|
+
"word_burstiness": burstiness_scores,
|
|
110
|
+
"num_words_analyzed": len(burstiness_scores),
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Entropy and Information-Theoretic Metrics
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
from collections import Counter
|
|
118
|
+
import numpy as np
|
|
119
|
+
|
|
120
|
+
def compute_entropy(text: str, level: str = "word") -> dict:
|
|
121
|
+
"""
|
|
122
|
+
Compute Shannon entropy at word or character level.
|
|
123
|
+
|
|
124
|
+
Higher entropy indicates more diverse, less predictable text.
|
|
125
|
+
AI-generated text often has lower entropy than human text.
|
|
126
|
+
"""
|
|
127
|
+
if level == "word":
|
|
128
|
+
tokens = text.lower().split()
|
|
129
|
+
elif level == "character":
|
|
130
|
+
tokens = list(text.lower())
|
|
131
|
+
else:
|
|
132
|
+
raise ValueError("level must be 'word' or 'character'")
|
|
133
|
+
|
|
134
|
+
counts = Counter(tokens)
|
|
135
|
+
total = sum(counts.values())
|
|
136
|
+
probabilities = np.array([c / total for c in counts.values()])
|
|
137
|
+
|
|
138
|
+
entropy = -np.sum(probabilities * np.log2(probabilities + 1e-12))
|
|
139
|
+
max_entropy = np.log2(len(counts)) if len(counts) > 1 else 1.0
|
|
140
|
+
normalized_entropy = entropy / max_entropy
|
|
141
|
+
|
|
142
|
+
return {
|
|
143
|
+
"entropy": entropy,
|
|
144
|
+
"normalized_entropy": normalized_entropy,
|
|
145
|
+
"vocabulary_size": len(counts),
|
|
146
|
+
"total_tokens": total,
|
|
147
|
+
"type_token_ratio": len(counts) / total,
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
def compute_conditional_entropy(text: str, n: int = 2) -> float:
|
|
151
|
+
"""Compute conditional entropy H(X_n | X_{n-1}) for n-gram analysis."""
|
|
152
|
+
words = text.lower().split()
|
|
153
|
+
if len(words) < n:
|
|
154
|
+
return 0.0
|
|
155
|
+
|
|
156
|
+
ngrams = [tuple(words[i:i+n]) for i in range(len(words) - n + 1)]
|
|
157
|
+
contexts = [ng[:-1] for ng in ngrams]
|
|
158
|
+
|
|
159
|
+
context_counts = Counter(contexts)
|
|
160
|
+
ngram_counts = Counter(ngrams)
|
|
161
|
+
|
|
162
|
+
h = 0.0
|
|
163
|
+
total = len(ngrams)
|
|
164
|
+
for ngram, count in ngram_counts.items():
|
|
165
|
+
context = ngram[:-1]
|
|
166
|
+
p_ngram = count / total
|
|
167
|
+
p_context = context_counts[context] / total
|
|
168
|
+
h -= p_ngram * np.log2(count / context_counts[context] + 1e-12)
|
|
169
|
+
|
|
170
|
+
return h
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## AI Text Detection Pipeline
|
|
174
|
+
|
|
175
|
+
Combining perplexity, burstiness, and entropy into a detection pipeline:
|
|
176
|
+
|
|
177
|
+
```python
|
|
178
|
+
def analyze_text_authenticity(text: str) -> dict:
|
|
179
|
+
"""
|
|
180
|
+
Multi-signal analysis for AI vs. human text classification.
|
|
181
|
+
Uses perplexity, burstiness, and entropy as features.
|
|
182
|
+
"""
|
|
183
|
+
perplexity_result = compute_perplexity(text)
|
|
184
|
+
burstiness_result = compute_burstiness(text)
|
|
185
|
+
entropy_result = compute_entropy(text, level="word")
|
|
186
|
+
char_entropy = compute_entropy(text, level="character")
|
|
187
|
+
|
|
188
|
+
# Heuristic thresholds from literature
|
|
189
|
+
signals = {
|
|
190
|
+
"low_perplexity": perplexity_result["perplexity"] < 30,
|
|
191
|
+
"low_burstiness": burstiness_result["average_burstiness"] < 0.1,
|
|
192
|
+
"low_entropy": entropy_result["normalized_entropy"] < 0.7,
|
|
193
|
+
"uniform_token_ppl": np.std(perplexity_result["token_perplexities"]) < 5,
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
ai_score = sum(signals.values()) / len(signals)
|
|
197
|
+
|
|
198
|
+
return {
|
|
199
|
+
"perplexity": perplexity_result["perplexity"],
|
|
200
|
+
"burstiness": burstiness_result["average_burstiness"],
|
|
201
|
+
"word_entropy": entropy_result["entropy"],
|
|
202
|
+
"char_entropy": char_entropy["entropy"],
|
|
203
|
+
"type_token_ratio": entropy_result["type_token_ratio"],
|
|
204
|
+
"ai_likelihood_score": ai_score,
|
|
205
|
+
"signals": signals,
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Tokenization Patterns
|
|
210
|
+
|
|
211
|
+
```python
|
|
212
|
+
from transformers import AutoTokenizer
|
|
213
|
+
|
|
214
|
+
def compare_tokenizers(text: str, models: list = None) -> dict:
|
|
215
|
+
"""Compare tokenization across different models for research analysis."""
|
|
216
|
+
if models is None:
|
|
217
|
+
models = ["gpt2", "bert-base-uncased", "facebook/opt-1.3b"]
|
|
218
|
+
|
|
219
|
+
results = {}
|
|
220
|
+
for model_name in models:
|
|
221
|
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
222
|
+
tokens = tokenizer.tokenize(text)
|
|
223
|
+
results[model_name] = {
|
|
224
|
+
"num_tokens": len(tokens),
|
|
225
|
+
"tokens": tokens[:50], # First 50 for inspection
|
|
226
|
+
"vocab_size": tokenizer.vocab_size,
|
|
227
|
+
"compression_ratio": len(text) / len(tokens),
|
|
228
|
+
}
|
|
229
|
+
return results
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Best Practices
|
|
233
|
+
|
|
234
|
+
- **Always specify the model** when computing perplexity. Perplexity is model-relative, not absolute.
|
|
235
|
+
- **Normalize by text length** when comparing entropy across texts of different sizes.
|
|
236
|
+
- **Use sliding windows** for long documents to capture local variation in metrics.
|
|
237
|
+
- **Combine multiple signals** for AI text detection -- no single metric is reliable alone.
|
|
238
|
+
- **Report confidence intervals** by computing metrics on paragraph-level chunks, then aggregating.
|
|
239
|
+
- **Be aware of domain shift.** Perplexity thresholds trained on news text will not transfer to scientific papers.
|
|
240
|
+
|
|
241
|
+
## References
|
|
242
|
+
|
|
243
|
+
- [Hugging Face Transformers](https://huggingface.co/docs/transformers/) -- Model hub and tokenizer library
|
|
244
|
+
- [DetectGPT](https://arxiv.org/abs/2301.11305) -- Perplexity-based AI text detection (Mitchell et al., 2023)
|
|
245
|
+
- [Burstiness and Memory in Text](https://doi.org/10.1103/PhysRevLett.114.078101) -- Altmann et al., 2015
|
|
246
|
+
- [NLTK documentation](https://www.nltk.org/) -- Classic NLP toolkit for feature engineering
|
|
247
|
+
- [spaCy documentation](https://spacy.io/) -- Industrial-strength NLP for production pipelines
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: npcpy-research-guide
|
|
3
|
+
description: "All-in-one Python library for NLP, agents, and knowledge graphs"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "🎭"
|
|
7
|
+
category: "domains"
|
|
8
|
+
subcategory: "ai-ml"
|
|
9
|
+
keywords: ["npcpy", "NLP", "agents", "knowledge graph", "all-in-one", "Python library"]
|
|
10
|
+
source: "https://github.com/NPC-Worldwide/npcpy"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# npcpy Research Guide
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
npcpy is an all-in-one Python library that combines NLP, agent orchestration, and knowledge graph capabilities in a single package. It provides tools for text processing, entity extraction, agent creation, graph-based reasoning, and research automation. Designed as a Swiss Army knife for AI researchers who need quick access to diverse NLP and agent capabilities without juggling many dependencies.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install npcpy
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Core Modules
|
|
26
|
+
|
|
27
|
+
### NLP Processing
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
from npcpy import NLP
|
|
31
|
+
|
|
32
|
+
nlp = NLP()
|
|
33
|
+
|
|
34
|
+
# Text processing pipeline
|
|
35
|
+
doc = nlp.process(
|
|
36
|
+
"Transformers have revolutionized NLP since Vaswani et al. "
|
|
37
|
+
"introduced the attention mechanism in 2017."
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
# Named entities
|
|
41
|
+
for entity in doc.entities:
|
|
42
|
+
print(f"[{entity.type}] {entity.text}")
|
|
43
|
+
# [METHOD] Transformers
|
|
44
|
+
# [PERSON] Vaswani
|
|
45
|
+
# [CONCEPT] attention mechanism
|
|
46
|
+
# [DATE] 2017
|
|
47
|
+
|
|
48
|
+
# Key phrases
|
|
49
|
+
print(doc.key_phrases)
|
|
50
|
+
# ["attention mechanism", "Transformers", "NLP"]
|
|
51
|
+
|
|
52
|
+
# Sentiment / stance
|
|
53
|
+
print(doc.sentiment) # positive
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Agent Creation
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from npcpy import Agent, Tool
|
|
60
|
+
|
|
61
|
+
# Create a research agent
|
|
62
|
+
agent = Agent(
|
|
63
|
+
name="research_assistant",
|
|
64
|
+
llm_provider="anthropic",
|
|
65
|
+
tools=[
|
|
66
|
+
Tool("web_search", description="Search the web"),
|
|
67
|
+
Tool("paper_search", description="Search academic papers"),
|
|
68
|
+
Tool("calculator", description="Math calculations"),
|
|
69
|
+
],
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
# Run a task
|
|
73
|
+
result = agent.run(
|
|
74
|
+
"Find the top 5 most cited papers on few-shot learning "
|
|
75
|
+
"from 2023 and summarize their approaches."
|
|
76
|
+
)
|
|
77
|
+
print(result.output)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Knowledge Graphs
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
from npcpy import KnowledgeGraph
|
|
84
|
+
|
|
85
|
+
kg = KnowledgeGraph()
|
|
86
|
+
|
|
87
|
+
# Extract knowledge from text
|
|
88
|
+
kg.extract_from_text(
|
|
89
|
+
"BERT uses masked language modeling for pre-training. "
|
|
90
|
+
"GPT uses autoregressive language modeling. "
|
|
91
|
+
"Both are based on the Transformer architecture."
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
# Query the graph
|
|
95
|
+
results = kg.query("What models use Transformer architecture?")
|
|
96
|
+
# ["BERT", "GPT"]
|
|
97
|
+
|
|
98
|
+
# Visualize
|
|
99
|
+
kg.visualize("knowledge_graph.html")
|
|
100
|
+
|
|
101
|
+
# Export
|
|
102
|
+
kg.export("kg.json")
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Research Workflows
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
from npcpy import ResearchWorkflow
|
|
109
|
+
|
|
110
|
+
workflow = ResearchWorkflow(llm_provider="anthropic")
|
|
111
|
+
|
|
112
|
+
# Literature search + synthesis
|
|
113
|
+
report = workflow.literature_review(
|
|
114
|
+
topic="prompt engineering techniques",
|
|
115
|
+
num_papers=20,
|
|
116
|
+
synthesis_style="academic",
|
|
117
|
+
)
|
|
118
|
+
report.save("review.md")
|
|
119
|
+
|
|
120
|
+
# Paper analysis
|
|
121
|
+
analysis = workflow.analyze_paper("paper.pdf")
|
|
122
|
+
print(analysis.summary)
|
|
123
|
+
print(analysis.methodology)
|
|
124
|
+
print(analysis.key_findings)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Use Cases
|
|
128
|
+
|
|
129
|
+
1. **Quick NLP**: Text processing without heavy setup
|
|
130
|
+
2. **Agent prototyping**: Rapid agent creation and testing
|
|
131
|
+
3. **Knowledge extraction**: Build KGs from research text
|
|
132
|
+
4. **Research automation**: Literature search and synthesis
|
|
133
|
+
5. **Teaching**: Demonstrate NLP/agent concepts
|
|
134
|
+
|
|
135
|
+
## References
|
|
136
|
+
|
|
137
|
+
- [npcpy GitHub](https://github.com/NPC-Worldwide/npcpy)
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pytorch-guide
|
|
3
|
+
description: "Avoid common PyTorch mistakes and apply robust training patterns"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "🔥"
|
|
7
|
+
category: "domains"
|
|
8
|
+
subcategory: "ai-ml"
|
|
9
|
+
keywords: ["PyTorch", "deep learning", "training loop", "GPU", "debugging", "autograd"]
|
|
10
|
+
source: "https://github.com/pytorch/pytorch"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# PyTorch Guide
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
PyTorch is the dominant deep learning framework in academic research, used in the majority of papers at NeurIPS, ICML, and ICLR. Its eager execution model, Pythonic API, and seamless integration with the Python scientific stack make it the default choice for prototyping and publishing research code.
|
|
18
|
+
|
|
19
|
+
However, PyTorch's flexibility is a double-edged sword. Subtle bugs -- forgetting `model.eval()`, accumulating gradients across batches, incorrect device placement, memory leaks from detached tensors -- can silently corrupt results without raising errors. These issues are especially dangerous in research settings where ground truth is unknown.
|
|
20
|
+
|
|
21
|
+
This guide catalogs the most common PyTorch mistakes, provides battle-tested training patterns, and covers performance optimization techniques that every researcher should know. The patterns here are drawn from top-tier ML research codebases and the PyTorch team's own best practice recommendations.
|
|
22
|
+
|
|
23
|
+
## Common Mistakes and Fixes
|
|
24
|
+
|
|
25
|
+
### The Big Five Mistakes
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
# MISTAKE 1: Forgetting model.eval() and torch.no_grad()
|
|
29
|
+
# This causes dropout and batch norm to behave incorrectly during evaluation
|
|
30
|
+
# and wastes memory by tracking gradients
|
|
31
|
+
|
|
32
|
+
# WRONG
|
|
33
|
+
def evaluate(model, dataloader):
|
|
34
|
+
total_correct = 0
|
|
35
|
+
for x, y in dataloader:
|
|
36
|
+
output = model(x) # Dropout still active! BN using batch stats!
|
|
37
|
+
total_correct += (output.argmax(1) == y).sum().item()
|
|
38
|
+
|
|
39
|
+
# RIGHT
|
|
40
|
+
@torch.no_grad()
|
|
41
|
+
def evaluate(model, dataloader):
|
|
42
|
+
model.eval()
|
|
43
|
+
total_correct = 0
|
|
44
|
+
for x, y in dataloader:
|
|
45
|
+
output = model(x)
|
|
46
|
+
total_correct += (output.argmax(1) == y).sum().item()
|
|
47
|
+
model.train() # Restore training mode
|
|
48
|
+
return total_correct
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
# MISTAKE 2: Not zeroing gradients (they accumulate by default!)
|
|
53
|
+
# WRONG - gradients from previous batch add to current batch
|
|
54
|
+
for x, y in dataloader:
|
|
55
|
+
loss = criterion(model(x), y)
|
|
56
|
+
loss.backward()
|
|
57
|
+
optimizer.step()
|
|
58
|
+
|
|
59
|
+
# RIGHT
|
|
60
|
+
for x, y in dataloader:
|
|
61
|
+
optimizer.zero_grad() # Clear previous gradients
|
|
62
|
+
loss = criterion(model(x), y)
|
|
63
|
+
loss.backward()
|
|
64
|
+
optimizer.step()
|
|
65
|
+
|
|
66
|
+
# BETTER (slightly faster, avoids memset)
|
|
67
|
+
for x, y in dataloader:
|
|
68
|
+
optimizer.zero_grad(set_to_none=True)
|
|
69
|
+
loss = criterion(model(x), y)
|
|
70
|
+
loss.backward()
|
|
71
|
+
optimizer.step()
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
# MISTAKE 3: Memory leaks from tensor operations in metrics
|
|
76
|
+
# WRONG - keeps entire computation graph in memory
|
|
77
|
+
losses = []
|
|
78
|
+
for x, y in dataloader:
|
|
79
|
+
loss = criterion(model(x), y)
|
|
80
|
+
losses.append(loss) # Retains computation graph!
|
|
81
|
+
|
|
82
|
+
# RIGHT - detach from graph and move to CPU
|
|
83
|
+
losses = []
|
|
84
|
+
for x, y in dataloader:
|
|
85
|
+
loss = criterion(model(x), y)
|
|
86
|
+
losses.append(loss.item()) # .item() extracts Python scalar
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
# MISTAKE 4: Incorrect device placement
|
|
91
|
+
# WRONG - model on GPU, data on CPU
|
|
92
|
+
model = model.cuda()
|
|
93
|
+
for x, y in dataloader:
|
|
94
|
+
output = model(x) # RuntimeError: tensors on different devices
|
|
95
|
+
|
|
96
|
+
# RIGHT
|
|
97
|
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
98
|
+
model = model.to(device)
|
|
99
|
+
for x, y in dataloader:
|
|
100
|
+
x, y = x.to(device), y.to(device)
|
|
101
|
+
output = model(x)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
# MISTAKE 5: Mutable default arguments in dataset transforms
|
|
106
|
+
# WRONG
|
|
107
|
+
class MyDataset(Dataset):
|
|
108
|
+
def __init__(self, data, transforms=[]): # Shared mutable list!
|
|
109
|
+
self.transforms = transforms
|
|
110
|
+
|
|
111
|
+
# RIGHT
|
|
112
|
+
class MyDataset(Dataset):
|
|
113
|
+
def __init__(self, data, transforms=None):
|
|
114
|
+
self.transforms = transforms or []
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Robust Training Template
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
import torch
|
|
121
|
+
import torch.nn as nn
|
|
122
|
+
from torch.utils.data import DataLoader
|
|
123
|
+
from torch.cuda.amp import autocast, GradScaler
|
|
124
|
+
import time
|
|
125
|
+
|
|
126
|
+
def train(
|
|
127
|
+
model: nn.Module,
|
|
128
|
+
train_loader: DataLoader,
|
|
129
|
+
val_loader: DataLoader,
|
|
130
|
+
optimizer: torch.optim.Optimizer,
|
|
131
|
+
scheduler,
|
|
132
|
+
num_epochs: int,
|
|
133
|
+
device: torch.device,
|
|
134
|
+
use_amp: bool = True,
|
|
135
|
+
):
|
|
136
|
+
"""Production-quality training loop with mixed precision and checkpointing."""
|
|
137
|
+
criterion = nn.CrossEntropyLoss()
|
|
138
|
+
scaler = GradScaler(enabled=use_amp)
|
|
139
|
+
best_val_loss = float("inf")
|
|
140
|
+
|
|
141
|
+
for epoch in range(num_epochs):
|
|
142
|
+
# --- Training ---
|
|
143
|
+
model.train()
|
|
144
|
+
train_loss = 0.0
|
|
145
|
+
t0 = time.time()
|
|
146
|
+
|
|
147
|
+
for batch_idx, (x, y) in enumerate(train_loader):
|
|
148
|
+
x, y = x.to(device, non_blocking=True), y.to(device, non_blocking=True)
|
|
149
|
+
|
|
150
|
+
optimizer.zero_grad(set_to_none=True)
|
|
151
|
+
|
|
152
|
+
with autocast(enabled=use_amp):
|
|
153
|
+
output = model(x)
|
|
154
|
+
loss = criterion(output, y)
|
|
155
|
+
|
|
156
|
+
scaler.scale(loss).backward()
|
|
157
|
+
scaler.unscale_(optimizer)
|
|
158
|
+
torch.nn.utils.clip_grad_norm_(model.parameters(), max_norm=1.0)
|
|
159
|
+
scaler.step(optimizer)
|
|
160
|
+
scaler.update()
|
|
161
|
+
|
|
162
|
+
train_loss += loss.item()
|
|
163
|
+
|
|
164
|
+
scheduler.step()
|
|
165
|
+
avg_train_loss = train_loss / len(train_loader)
|
|
166
|
+
|
|
167
|
+
# --- Validation ---
|
|
168
|
+
model.eval()
|
|
169
|
+
val_loss = 0.0
|
|
170
|
+
correct = 0
|
|
171
|
+
total = 0
|
|
172
|
+
|
|
173
|
+
with torch.no_grad():
|
|
174
|
+
for x, y in val_loader:
|
|
175
|
+
x, y = x.to(device, non_blocking=True), y.to(device, non_blocking=True)
|
|
176
|
+
with autocast(enabled=use_amp):
|
|
177
|
+
output = model(x)
|
|
178
|
+
loss = criterion(output, y)
|
|
179
|
+
val_loss += loss.item()
|
|
180
|
+
correct += (output.argmax(1) == y).sum().item()
|
|
181
|
+
total += y.size(0)
|
|
182
|
+
|
|
183
|
+
avg_val_loss = val_loss / len(val_loader)
|
|
184
|
+
val_acc = correct / total
|
|
185
|
+
|
|
186
|
+
# --- Checkpoint ---
|
|
187
|
+
if avg_val_loss < best_val_loss:
|
|
188
|
+
best_val_loss = avg_val_loss
|
|
189
|
+
torch.save({
|
|
190
|
+
"epoch": epoch,
|
|
191
|
+
"model_state_dict": model.state_dict(),
|
|
192
|
+
"optimizer_state_dict": optimizer.state_dict(),
|
|
193
|
+
"val_loss": avg_val_loss,
|
|
194
|
+
}, "best_checkpoint.pt")
|
|
195
|
+
|
|
196
|
+
elapsed = time.time() - t0
|
|
197
|
+
print(f"Epoch {epoch+1}/{num_epochs} | "
|
|
198
|
+
f"Train Loss: {avg_train_loss:.4f} | "
|
|
199
|
+
f"Val Loss: {avg_val_loss:.4f} | "
|
|
200
|
+
f"Val Acc: {val_acc:.4f} | "
|
|
201
|
+
f"Time: {elapsed:.1f}s")
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Performance Optimization
|
|
205
|
+
|
|
206
|
+
| Technique | Speedup | Effort | When to Use |
|
|
207
|
+
|-----------|---------|--------|-------------|
|
|
208
|
+
| Mixed precision (AMP) | 1.5-3x | Low | Always on modern GPUs |
|
|
209
|
+
| `torch.compile()` | 1.2-2x | Low | PyTorch 2.0+, stable models |
|
|
210
|
+
| `pin_memory=True` in DataLoader | 1.1-1.3x | Trivial | Always with GPU training |
|
|
211
|
+
| `non_blocking=True` in `.to()` | 1.05-1.1x | Trivial | Always with pinned memory |
|
|
212
|
+
| Gradient accumulation | N/A | Low | When batch size limited by memory |
|
|
213
|
+
| `torch.backends.cudnn.benchmark = True` | 1.1-1.5x | Trivial | Fixed input sizes |
|
|
214
|
+
| Distributed Data Parallel | Near-linear | Medium | Multi-GPU training |
|
|
215
|
+
|
|
216
|
+
### GPU Memory Management
|
|
217
|
+
|
|
218
|
+
```python
|
|
219
|
+
# Check GPU memory usage
|
|
220
|
+
print(f"Allocated: {torch.cuda.memory_allocated() / 1e9:.2f} GB")
|
|
221
|
+
print(f"Cached: {torch.cuda.memory_reserved() / 1e9:.2f} GB")
|
|
222
|
+
|
|
223
|
+
# Force garbage collection when debugging OOM
|
|
224
|
+
torch.cuda.empty_cache()
|
|
225
|
+
import gc; gc.collect()
|
|
226
|
+
|
|
227
|
+
# Gradient accumulation for effective large batch sizes
|
|
228
|
+
accumulation_steps = 4
|
|
229
|
+
for i, (x, y) in enumerate(dataloader):
|
|
230
|
+
loss = criterion(model(x.to(device)), y.to(device)) / accumulation_steps
|
|
231
|
+
loss.backward()
|
|
232
|
+
if (i + 1) % accumulation_steps == 0:
|
|
233
|
+
optimizer.step()
|
|
234
|
+
optimizer.zero_grad(set_to_none=True)
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Reproducibility Checklist
|
|
238
|
+
|
|
239
|
+
```python
|
|
240
|
+
import torch
|
|
241
|
+
import numpy as np
|
|
242
|
+
import random
|
|
243
|
+
|
|
244
|
+
def seed_everything(seed=42):
|
|
245
|
+
random.seed(seed)
|
|
246
|
+
np.random.seed(seed)
|
|
247
|
+
torch.manual_seed(seed)
|
|
248
|
+
torch.cuda.manual_seed_all(seed)
|
|
249
|
+
torch.backends.cudnn.deterministic = True
|
|
250
|
+
torch.backends.cudnn.benchmark = False
|
|
251
|
+
# For DataLoader workers
|
|
252
|
+
def seed_worker(worker_id):
|
|
253
|
+
worker_seed = seed + worker_id
|
|
254
|
+
np.random.seed(worker_seed)
|
|
255
|
+
random.seed(worker_seed)
|
|
256
|
+
return seed_worker
|
|
257
|
+
|
|
258
|
+
seed_worker = seed_everything(42)
|
|
259
|
+
dataloader = DataLoader(
|
|
260
|
+
dataset, batch_size=32, shuffle=True,
|
|
261
|
+
worker_init_fn=seed_worker,
|
|
262
|
+
generator=torch.Generator().manual_seed(42),
|
|
263
|
+
)
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## Best Practices
|
|
267
|
+
|
|
268
|
+
- **Always use `torch.no_grad()` for inference.** It reduces memory usage by ~50%.
|
|
269
|
+
- **Prefer `model.to(device)` over `.cuda()`.** It is device-agnostic and works on CPU, CUDA, and MPS.
|
|
270
|
+
- **Use `torch.compile(model)` on PyTorch 2.0+** for free speedups on stable architectures.
|
|
271
|
+
- **Profile before optimizing.** Use `torch.profiler` to find actual bottlenecks.
|
|
272
|
+
- **Pin your PyTorch version in `requirements.txt`.** Different versions can produce different numerical results.
|
|
273
|
+
- **Use `torchinfo` for model summary** instead of printing the model object.
|
|
274
|
+
|
|
275
|
+
## References
|
|
276
|
+
|
|
277
|
+
- [PyTorch documentation](https://pytorch.org/docs/stable/) -- Official API reference
|
|
278
|
+
- [PyTorch tutorials](https://pytorch.org/tutorials/) -- End-to-end examples from the PyTorch team
|
|
279
|
+
- [PyTorch best practices](https://pytorch.org/docs/stable/notes/cuda.html) -- CUDA semantics and best practices
|
|
280
|
+
- [Effective PyTorch](https://github.com/vahidk/EffectivePyTorch) -- Community best practices guide
|
|
281
|
+
- [PyTorch Lightning](https://lightning.ai/) -- High-level training framework built on PyTorch
|