mcpField
S
Semantic Scholar Lookup

Semantic Scholar Lookup

github.com/allenai生产力4250 次安装1 天前更新
代码仓库

关于 Semantic Scholar Lookup

通过 `asta` 命令行调用 Semantic Scholar API 的定向文献查询技能,帮助研究者获取论文与作者信息、搜索全文片段和查看引用关系,不用于生成综合文献报告。

主要功能

  1. 01获取论文元数据
  2. 02按关键词和日期搜索论文
  3. 03查找全文片段
  4. 04查看引用该论文的作品
  5. 05搜索作者及其论文

适用场景

  1. 01核查论文元数据
  2. 02在论文文本中查找证据
  3. 03追踪论文引用关系
  4. 04列出某位作者的出版物

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/allenai/asta-plugins --skill semantic-scholar-lookup

安装后在 Claude Code 中输入/semantic-scholar-lookup确认已加载。

详细介绍

Semantic Scholar 查询

通过 `asta papers` 命令调用 Semantic Scholar API,快速精准地查询论文元数据、引用和作者。

何时使用此技能

  • 用户询问某篇特定论文的详细信息(按标题、DOI、arXiv ID 等)
  • 用户想查看引用某篇作品的论文
  • 用户询问某位作者的论文
  • 用户想快速按关键词搜索(而非生成全面报告)
  • 用户想在论文全文中查找特定论点、方法或证据(使用 snippet-search)
  • 任务需要查询特定论文元数据或引用图谱

不用于生成全面报告——此类任务请使用 Literature Report Generation 技能。

安装

此技能需要 asta CLI:

# Install/reinstall at the correct version
PLUGIN_VERSION=0.16.0
if [ "$(asta --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')" != "$PLUGIN_VERSION" ]; then
  uv tool install --force git+https://github.com/allenai/asta-plugins.git@v$PLUGIN_VERSION
fi

**前置条件:**Python 3.11+ 和 uv package manager

可用命令

获取论文详情

asta papers get——按 ID 获取单篇论文的元数据

asta papers get ARXIV:2005.14165

asta papers get "DOI:10.18653/v1/N18-3011" --fields title,year,authors,abstract

asta papers get CorpusId:215416146 --format text

支持的 ID 格式:

  • ARXIV:2106.15928
  • DOI:10.18653/v1/N18-3011
  • CorpusId:215416146
  • PMID:19872477
  • URL:https://arxiv.org/abs/2106.15928

常用字段:title,abstract,authors,year,venue,citationCount,publicationDate,url,isOpenAccess,fieldsOfStudy

搜索论文

asta papers search——按关键词搜索论文

asta papers search "transformers attention mechanism"

asta papers search "RLHF" --date 2023- --limit 10

asta papers search "neural networks" --fields title,year,abstract,authors

asta papers search "LLM safety" --date 2024-01-01:2024-12-31

选项:

  • --fields:以逗号分隔的返回字段
  • --limit:结果数量(默认 20,最多 100)
  • --date:出版日期或年份筛选条件。接受年份(2020、2020-2024、2020-)或日期范围(2024-01-01:2024-12-31)。映射到 S2 的 publicationDateOrYear 参数。
  • --format:将输出设为 json 或 text
片段搜索

asta papers snippet-search——通过 S2 snippet/search API 搜索论文全文(标题、摘要和正文)。返回匹配的文本摘录及论文元数据。

asta papers snippet-search "in-context learning emerges at scale"

asta papers snippet-search "RLHF reward hacking" --date 2023- --limit 10

asta papers snippet-search "sparse mixture of experts" --fields snippet.text,snippet.snippetKind,snippet.section

# Pin results to papers indexed before a date (useful for reproducible benchmarks)
asta papers snippet-search "chain-of-thought" --inserted-before 2024-01-01

--fields 选项接受片段字段:

  • snippet.text——匹配的文本摘录(约 500 个词)
  • snippet.snippetKind——来源类型(例如标题、摘要、正文)
  • snippet.section——片段所在的论文章节
  • snippet.snippetOffset——字符位置信息(start、end)
  • snippet.annotations——标记信息,包括参考文献提及和句子边界

如果省略 --fields,默认值为 snippet.text,snippet.snippetKind。无论是否指定 --fields,都会返回论文元数据(corpusId、标题、作者、openAccessInfo)和相关性评分。

选项:

  • --fields:以逗号分隔的返回片段字段
  • --date:日期/年份筛选条件,与标准搜索相同
  • --limit:结果数量上限(默认 20,最多 1000——上限高于标准搜索)
  • --inserted-before:仅包含在此日期之前编入索引的论文(YYYY-MM-DD、YYYY-MM 或 YYYY)。通常用于确保基准测试的一致性——固定截止日期可确保多次运行返回相同的论文集合,即使新论文仍在不断编入索引。
  • --format:将输出设为 json 或 text
获取引用

asta papers citations——获取引用指定作品的论文

asta papers citations ARXIV:2005.14165

asta papers citations CorpusId:218487638 --limit 20 --format text

选项:

  • --fields:引用论文的字段
  • --limit:结果数量上限(默认 50,最多 1000)
  • --format:将输出设为 json 或 text
搜索作者及其论文

asta papers author search——按姓名查找作者

asta papers author search "Yoav Goldberg"

asta papers author search "Hinton" --limit 5 --format text

asta papers author papers——获取某位作者的论文

# First, get author ID from search
asta papers author search "Yoav Goldberg"

# Then get their papers using the author ID
asta papers author papers 1741101 --limit 50

asta papers author papers 1741101 --fields title,year,venue,citationCount

选项:

  • --fields:论文的返回字段
  • --limit:结果数量上限(默认 50,最多 1000)
  • --format:将输出设为 json 或 text

输出格式

所有命令都支持两种输出格式:

JSON 格式(默认):

  • 机器可读
  • 数据结构完整
  • 可通过管道传递给 jq 进行筛选
  • 最适合编程使用

文本格式(--format text):

  • 易于阅读
  • 格式化输出
  • 最适合快速浏览
  • 向用户展示结果时使用

使用提示

高效选择字段

仅请求所需字段,以加快响应速度:

# Good - minimal fields for quick browse
asta papers search "deep learning" --fields title,year,authors,citationCount

# Less efficient - many fields slow down response
asta papers search "deep learning" --fields title,abstract,authors,year,venue,citations,references
日期筛选

适当缩小范围,仅查找近期论文:

asta papers search "RLHF" --date 2023-2024  # 2023-2024
asta papers search "RLHF" --date 2023-      # 2023 onwards
asta papers search "RLHF" --date -2020      # Before 2020
asta papers search "RLHF" --date 2024-06-01:2024-12-31  # Specific date range
管道传递给 jq

用于复杂的 JSON 处理:

# Extract just titles
asta papers search "transformers" | jq '.data[].title'

# Filter by citation count
asta papers search "neural networks" | jq '.data[] | select(.citationCount > 100)'

# Get author names
asta papers get ARXIV:2005.14165 | jq '.authors[].name'
多步工作流

组合命令以处理复杂查询:

示例 1:查找作者近期被大量引用的论文

# 1. Find author
asta papers author search "Geoffrey Hinton" --format text

# 2. Get their recent papers
asta papers author papers 1751273 --fields title,year,citationCount --limit 50 | \
  jq '.data[].paper | select(.year >= 2020) | select(.citationCount > 100)'

示例 2:探索引用网络

# 1. Get paper details
asta papers get ARXIV:2005.14165

# 2. Get who cited it
asta papers citations ARXIV:2005.14165 --limit 20 --format text

# 3. Get details on specific citing papers
asta papers get CorpusId:123456789

示例工作流

“获取 arXiv:2005.14165 的详情”
asta papers get ARXIV:2005.14165 --format text

以便于阅读的格式向用户呈现输出。

“有哪些论文引用了 GPT-3 论文?”
# GPT-3 paper
asta papers citations ARXIV:2005.14165 --limit 50 --format text

从结果中展示近期或被大量引用的论文。

“RLHF 领域的近期论文”
asta papers search "RLHF reinforcement learning from human feedback" \
  --date 2023- \
  --limit 20 \
  --fields title,abstract,year,authors,venue,citationCount \
  --format text
“Yoav Goldberg 撰写的论文”
# Step 1: Find author
asta papers author search "Yoav Goldberg" --format text

# Step 2: Get their papers (using author ID from step 1)
asta papers author papers 1741101 \
  --fields title,year,venue,citationCount \
  --limit 50 \
  --format text
“查找‘chain-of-thought’推理的证据”
# Snippet search finds mentions in paper bodies, not just titles/abstracts
asta papers snippet-search "chain-of-thought reasoning improves performance" \
  --limit 15

# Or use standard search for paper-level results
asta papers search "chain-of-thought reasoning" \
  --fields title,abstract,year,authors \
  --limit 15

# Then examine specific papers with 'asta papers get'

响应呈现

向用户展示结果时:

单篇论文:

**Title** (Year)
Authors: [author list]
Venue: [venue name]
Citations: [count]

[Abstract]

URL: [Semantic Scholar link]

论文列表:

Found [N] papers:

1. **Paper Title** - Author et al. (Year) - [Venue] - [X citations]
2. **Another Paper** - ...
...

片段搜索结果(snippet-search):

Found [N] snippet results:

1. **Paper Title** - Author et al.
   Score: 0.95
   Snippet (abstract): "...matching text excerpt..."
2. **Another Paper** - ...
...

引用:

Found [N] papers citing this work:

Recent citations:
1. [Paper 1] (2024) - [citations]
2. [Paper 2] (2023) - [citations]
...

最佳实践

  • 直接向用户展示结果时,使用 --format text
  • 需要处理或筛选结果时,使用 JSON 输出
  • 从较小的限制值开始,根据需要逐步增加
  • 只获取实际会用到的字段
  • 搜索论文正文中的特定主张、方法或证据时,使用 snippet-search
  • 按主题发现论文时,使用 search
  • 如需全面研究,建议使用 Literature Report Generation 技能
  • 适当时提供 Semantic Scholar URL(https://semanticscholar.org/paper/{paperId})

API 密钥

如果存在 ASTA_TOOL_KEY 环境变量,命令会使用它。大多数查询无需密钥即可运行,但使用密钥可获得更高的速率限制。

评论

支持 Markdown