Buckets:

download
raw
15.1 kB
"""High-Value Dataset Report Generator for AI Dataset Radar v3.
Generates comprehensive reports focusing on dataset value scores,
SOTA associations, citation trends, and domain-specific insights.
"""
import os
from datetime import datetime
from typing import Optional
class ValueReportGenerator:
"""Generate high-value dataset reports."""
def __init__(self, output_dir: str = "data"):
"""Initialize the report generator.
Args:
output_dir: Directory to save reports.
"""
self.output_dir = output_dir
os.makedirs(output_dir, exist_ok=True)
def generate_report(
self,
scored_datasets: list[dict],
sota_results: Optional[dict] = None,
citation_data: Optional[list[dict]] = None,
model_card_results: Optional[dict] = None,
domain_breakdown: Optional[dict] = None,
) -> str:
"""Generate a comprehensive value report.
Args:
scored_datasets: List of datasets with value scores.
sota_results: Results from SOTA analysis.
citation_data: Citation tracking data.
model_card_results: Results from model card analysis.
domain_breakdown: Datasets grouped by domain.
Returns:
Path to the generated report file.
"""
lines = []
# Header
lines.extend(
[
"# 高价值数据集周报",
f"*Generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}*",
"",
]
)
# Top 10 high-value datasets
lines.extend(self._generate_top_datasets_section(scored_datasets))
# Newly discovered high-value datasets
lines.extend(self._generate_new_discoveries_section(scored_datasets))
# Domain breakdown
if domain_breakdown:
lines.extend(self._generate_domain_section(domain_breakdown))
# SOTA associations
if sota_results:
lines.extend(self._generate_sota_section(sota_results))
# Citation trends
if citation_data:
lines.extend(self._generate_citation_section(citation_data))
# Model usage insights
if model_card_results:
lines.extend(self._generate_model_usage_section(model_card_results))
# Papers worth attention
lines.extend(self._generate_papers_section(scored_datasets))
# Summary statistics
lines.extend(
self._generate_summary_section(
scored_datasets, sota_results, citation_data, model_card_results
)
)
# Footer
lines.extend(
[
"",
"---",
"> Report generated by AI Dataset Radar v3 — High-Value Dataset Discovery System",
]
)
report_content = "\n".join(lines)
# Save report
date_str = datetime.now().strftime("%Y-%m-%d")
filename = f"value_report_{date_str}.md"
filepath = os.path.join(self.output_dir, filename)
with open(filepath, "w", encoding="utf-8") as f:
f.write(report_content)
return filepath
def _generate_top_datasets_section(self, scored_datasets: list[dict]) -> list[str]:
"""Generate the top datasets section."""
lines = [
"## 🏆 Top 10 高价值数据集",
"",
"| 排名 | 数据集 | 评分 | SOTA模型数 | 引用增长 | 领域 | 机构 |",
"|------|--------|------|------------|----------|------|------|",
]
for i, ds in enumerate(scored_datasets[:10], 1):
name = ds.get("dataset_name", "Unknown")[:30]
score = ds.get("total_score", 0)
sota_count = ds.get("signals", {}).get("sota_model_count", 0)
cite_growth = ds.get("signals", {}).get("citation_monthly_growth", 0)
domain = ds.get("original_data", {}).get("domain", "-")
institution = ds.get("signals", {}).get("institution", "-") or "-"
if len(institution) > 15:
institution = institution[:12] + "..."
cite_str = f"{cite_growth:.1f}/月" if cite_growth else "-"
lines.append(
f"| {i} | {name} | {score} | {sota_count} | {cite_str} | {domain or '-'} | {institution} |"
)
lines.append("")
return lines
def _generate_new_discoveries_section(self, scored_datasets: list[dict]) -> list[str]:
"""Generate section for newly discovered datasets."""
lines = [
"## 📈 新晋高价值数据集",
"",
]
# Filter for datasets that might be new (high score but low awareness)
new_datasets = [
ds
for ds in scored_datasets
if ds.get("total_score", 0) >= 40
and ds.get("signals", {}).get("model_usage_count", 0) < 5
][:5]
if new_datasets:
lines.append("| 数据集 | 评分 | 发现原因 | 潜在价值 |")
lines.append("|--------|------|----------|----------|")
for ds in new_datasets:
name = ds.get("dataset_name", "Unknown")[:25]
score = ds.get("total_score", 0)
# Determine discovery reason
reasons = []
signals = ds.get("signals", {})
if signals.get("sota_model_count", 0) > 0:
reasons.append("SOTA使用")
if signals.get("citation_monthly_growth", 0) >= 10:
reasons.append("引用快增")
if ds.get("is_top_institution"):
reasons.append("顶级机构")
reason_str = ", ".join(reasons) if reasons else "综合评分"
# Potential value assessment
if score >= 60:
potential = "极高"
elif score >= 40:
potential = "高"
else:
potential = "中等"
lines.append(f"| {name} | {score} | {reason_str} | {potential} |")
else:
lines.append("本周暂无新发现的高价值数据集")
lines.append("")
return lines
def _generate_domain_section(self, domain_breakdown: dict) -> list[str]:
"""Generate domain-specific sections."""
lines = [
"## 🤖 按领域分类",
"",
]
domain_labels = {
"robotics": "Robotics 机器人",
"nlp": "LLM/NLP 语言模型",
"vision": "Vision/Multimodal 视觉多模态",
"code": "Code Generation 代码生成",
"rlhf": "RLHF/Alignment 对齐",
}
for domain, datasets in domain_breakdown.items():
if not datasets:
continue
label = domain_labels.get(domain, domain.title())
lines.append(f"### {label}")
lines.append("")
# Top 5 in each domain
top_domain = sorted(
datasets,
key=lambda x: x.get("total_score", x.get("value_score", 0)),
reverse=True,
)[:5]
if top_domain:
lines.append("| 数据集 | 评分 | 特点 |")
lines.append("|--------|------|------|")
for ds in top_domain:
name = ds.get("dataset_name", ds.get("name", "Unknown"))[:30]
score = ds.get("total_score", ds.get("value_score", 0))
features = []
if ds.get("signals", {}).get("sota_model_count", 0) > 0:
features.append("SOTA")
if ds.get("is_top_institution") or ds.get("signals", {}).get("institution"):
features.append("顶级机构")
if ds.get("signals", {}).get("has_paper"):
features.append("有论文")
feature_str = ", ".join(features) if features else "-"
lines.append(f"| {name} | {score} | {feature_str} |")
lines.append("")
return lines
def _generate_sota_section(self, sota_results: dict) -> list[str]:
"""Generate SOTA association section."""
lines = [
"## 🎯 SOTA 关联分析",
"",
]
ranked = sota_results.get("ranked_datasets", [])[:10]
if ranked:
lines.append("| 数据集 | SOTA模型数 | 覆盖领域 | 代表模型 |")
lines.append("|--------|------------|----------|----------|")
for ds in ranked:
name = ds.get("name", "Unknown")[:25]
count = ds.get("sota_model_count", 0)
areas = ", ".join(ds.get("areas", [])[:2]) or "-"
top_model = "-"
if ds.get("sota_models"):
top_model = ds["sota_models"][0].get("model_name", "-")[:20]
lines.append(f"| {name} | {count} | {areas} | {top_model} |")
else:
lines.append("暂无 SOTA 关联数据")
lines.append("")
return lines
def _generate_citation_section(self, citation_data: list[dict]) -> list[str]:
"""Generate citation trends section."""
lines = [
"## 📚 引用趋势",
"",
]
# Filter for high-growth papers
high_growth = [p for p in citation_data if p.get("citation_monthly_growth", 0) >= 10][:10]
if high_growth:
lines.append("| 论文/数据集 | 当前引用 | 月增长 | 增长率 |")
lines.append("|-------------|----------|--------|--------|")
for paper in high_growth:
title = paper.get("paper_title", paper.get("dataset_name", "Unknown"))[:30]
citations = paper.get("citation_count", 0)
growth = paper.get("citation_monthly_growth", 0)
rate = (
f"{(growth / max(citations - growth, 1) * 100):.1f}%"
if citations > growth
else "N/A"
)
lines.append(f"| {title} | {citations} | +{growth:.1f} | {rate} |")
else:
lines.append("暂无显著引用增长数据")
lines.append("")
return lines
def _generate_model_usage_section(self, model_card_results: dict) -> list[str]:
"""Generate model usage insights section."""
lines = [
"## 🔗 模型使用分析",
"",
]
valuable = model_card_results.get("valuable_datasets", [])[:10]
if valuable:
lines.append("| 数据集 | 使用模型数 | 累计下载量 | 代表模型 |")
lines.append("|--------|------------|------------|----------|")
for ds in valuable:
name = ds.get("name", "Unknown")[:25]
usage = ds.get("usage_count", 0)
downloads = ds.get("total_model_downloads", 0)
top_model = ds.get("top_model", "-")[:20] if ds.get("top_model") else "-"
downloads_str = f"{downloads:,}" if downloads else "-"
lines.append(f"| {name} | {usage} | {downloads_str} | {top_model} |")
else:
lines.append("暂无模型使用数据")
lines.append("")
return lines
def _generate_papers_section(self, scored_datasets: list[dict]) -> list[str]:
"""Generate section for papers worth attention."""
lines = [
"## 🔬 值得关注的新论文",
"",
]
# Extract papers from scored datasets
papers_with_data = [
ds
for ds in scored_datasets
if ds.get("signals", {}).get("has_paper") and ds.get("total_score", 0) >= 30
][:10]
if papers_with_data:
lines.append("| 数据集/论文 | 评分 | 机构 | 链接 |")
lines.append("|-------------|------|------|------|")
for ds in papers_with_data:
name = ds.get("dataset_name", "Unknown")[:30]
score = ds.get("total_score", 0)
inst = ds.get("signals", {}).get("institution", "-") or "-"
if len(inst) > 12:
inst = inst[:10] + ".."
paper_url = ds.get("original_data", {}).get("paper_url")
arxiv_id = ds.get("original_data", {}).get("arxiv_id")
if paper_url:
link = f"[Link]({paper_url})"
elif arxiv_id:
link = f"[arXiv](https://arxiv.org/abs/{arxiv_id})"
else:
link = "-"
lines.append(f"| {name} | {score} | {inst} | {link} |")
else:
lines.append("暂无新论文推荐")
lines.append("")
return lines
def _generate_summary_section(
self,
scored_datasets: list[dict],
sota_results: Optional[dict],
citation_data: Optional[list[dict]],
model_card_results: Optional[dict],
) -> list[str]:
"""Generate summary statistics section."""
lines = [
"## 📊 统计摘要",
"",
]
total = len(scored_datasets)
high_value = len([d for d in scored_datasets if d.get("total_score", 0) >= 60])
medium_value = len([d for d in scored_datasets if 40 <= d.get("total_score", 0) < 60])
top_inst = len([d for d in scored_datasets if d.get("is_top_institution")])
lines.append(f"- **分析数据集总数:** {total} 个")
lines.append(f"- **高价值数据集 (≥60分):** {high_value} 个")
lines.append(f"- **中等价值数据集 (40-59分):** {medium_value} 个")
lines.append(f"- **顶级机构数据集:** {top_inst} 个")
if sota_results:
sota_count = sota_results.get("unique_datasets", 0)
lines.append(f"- **SOTA 关联数据集:** {sota_count} 个")
if citation_data:
high_cite = len([p for p in citation_data if p.get("citation_monthly_growth", 0) >= 10])
lines.append(f"- **高引用增长论文:** {high_cite} 篇")
if model_card_results:
model_count = model_card_results.get("models_analyzed", 0)
lines.append(f"- **分析模型数量:** {model_count} 个")
lines.append("")
return lines
def generate_value_report(
scored_datasets: list[dict],
output_dir: str = "data",
**kwargs,
) -> str:
"""Convenience function to generate a value report.
Args:
scored_datasets: List of datasets with value scores.
output_dir: Directory to save the report.
**kwargs: Additional data (sota_results, citation_data, etc.)
Returns:
Path to the generated report.
"""
generator = ValueReportGenerator(output_dir)
return generator.generate_report(scored_datasets, **kwargs)

Xet Storage Details

Size:
15.1 kB
·
Xet hash:
404151f9e8c758fccdef2f8bb2550076edc82b041c34972c8eafeded61f853e6

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.