Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:ThreeSR Awesome Inference Time Scaling Format Paper Info Function

From Leeroopedia
Metadata
Knowledge Sources
Domains
Last Updated 2026-02-14 00:00 GMT

Overview

Concrete function for transforming a Semantic Scholar paper metadata dictionary into a standardized markdown entry block, provided by the fetch_semantic_info.py script in the Awesome-Inference-Time-Scaling repository.

Description

The format_paper_info() function accepts a single paper dictionary (as returned by the Semantic Scholar search API) and produces a markdown-formatted string suitable for insertion into the repository's README. It performs the following steps:

  1. Extracts the title, authors list, paperId, publicationDate, and venue from the input dictionary.
  2. Calls get_paper_info(paperId) internally to fetch the arxivId and abstract from the Semantic Scholar paper details endpoint.
  3. Applies default values for any missing fields: title defaults to "N/A", abstract to "No abstract available.", and an empty venue string to "arXiv.org".
  4. Constructs arXiv abstract and PDF URLs from the resolved arxivId.
  5. Renders a multi-line markdown string with an emoji-prefixed title link, PDF link, author list, date, publisher, and a collapsible abstract using HTML <details> tags.

The function is pure string formatting with one side effect: the internal call to get_paper_info() makes an HTTP request to the Semantic Scholar API.

Usage

Import and call this function when you need to convert a paper dictionary into the project's standard entry format:

from fetch_semantic_info import format_paper_info

paper = {
    "title": "Scaling LLM Test-Time Compute",
    "authors": [{"name": "Charlie Snell"}, {"name": "Jaehoon Lee"}],
    "paperId": "abc123",
    "publicationDate": "2024-08-06",
    "venue": "arXiv.org"
}
md_block = format_paper_info(paper)
print(md_block)

Code Reference

Source Location

  • Repository: ThreeSR/Awesome-Inference-Time-Scaling
  • File: fetch_semantic_info.py (lines 48--75)

Signature

def format_paper_info(paper: dict) -> str:
    """Format paper information into markdown text"""

Import

from fetch_semantic_info import format_paper_info

I/O Contract

Inputs

Input Contract
Name Type Description
paper dict A paper metadata dictionary as returned by the Semantic Scholar search API. Expected keys: title (str), authors (list of dicts each with a name key), paperId (str), publicationDate (str in YYYY-MM-DD format), venue (str).

Outputs

Output Contract
Name Type Description
Return value str A multi-line markdown string matching the README entry template. Begins with a marker line (🔹 [Title](url)) followed by bullet lines for PDF link, authors, date, publisher, and a collapsible abstract block.

Usage Examples

Example 1: Standard Paper Entry

Format a paper with all fields present.

from fetch_semantic_info import format_paper_info

paper = {
    "title": "Scaling LLM Test-Time Compute Optimally",
    "authors": [
        {"name": "Charlie Snell"},
        {"name": "Jaehoon Lee"},
        {"name": "Kimin Lee"},
        {"name": "Anja Hauth"}
    ],
    "paperId": "abc123def456",
    "publicationDate": "2024-08-06",
    "venue": "ICML"
}

result = format_paper_info(paper)
# Returns a markdown block such as:
# 🔹 [Scaling LLM Test-Time Compute Optimally](https://arxiv.org/abs/2408.xxxxx)
# - 🔗 **arXiv PDF Link:** [Paper Link](https://arxiv.org/pdf/2408.xxxxx)
# - 👤 **Authors:** Charlie Snell, Jaehoon Lee, Kimin Lee, Anja Hauth
# - 🗓️ **Date:** 2024-08-06
# - 📑 **Publisher:** ICML
# - 📝 **Abstract:**
#     <details>
#     <summary>Expand</summary>
#     ...abstract text fetched via get_paper_info()...
#     </details>

Example 2: Paper With Empty Venue

When venue is an empty string, the function defaults to "arXiv.org".

from fetch_semantic_info import format_paper_info

paper = {
    "title": "Chain-of-Thought Reasoning Without Prompting",
    "authors": [{"name": "Xuezhi Wang"}, {"name": "Denny Zhou"}],
    "paperId": "xyz789",
    "publicationDate": "2024-02-15",
    "venue": ""
}

result = format_paper_info(paper)
# The Publisher line will read:
# - 📑 **Publisher:** arXiv.org

Example 3: Integration With write_to_readme_in_sorted_order

This function is called internally by write_to_readme_in_sorted_order() to generate entry blocks for new papers before merging them into the README.

from fetch_semantic_info import search_papers, write_to_readme_in_sorted_order

papers = search_papers("Inference-Time Scaling", limit=3)
# write_to_readme_in_sorted_order calls format_paper_info() for each new paper
write_to_readme_in_sorted_order(papers)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment