A Python toolkit for collecting academic papers from Semantic Scholar and analyzing/visualizing publication trends in machine learning research
Project description
ML Research Trends
A Python toolkit for collecting academic papers from Semantic Scholar and analyzing/visualizing publication trends in machine learning research.
Features
- Data Collection: Collect papers from Semantic Scholar API based on keywords and date ranges
- Trend Analysis: Analyze publication trends, citation patterns, and temporal distributions
- Visualization: Create publication trend plots, embedding visualizations, and landmark timelines
- Embedding Analysis: Generate and visualize paper abstract embeddings using transformer models
- Flexible API: Easy-to-use functions for data collection, analysis, and visualization
Installation
pip install ml-research-trends
Or with uv:
uv add ml-research-trends
Requirements
- Python >= 3.11
- Semantic Scholar API key (set as environment variable
SEMANTIC_SCHOLAR_API_KEY)
Quick Start
from ml_research_trends import (
collect_topic_data,
summarize_topic_data,
analyze_topic_trends,
plot_topic_counts_by_year,
)
# Collect papers on a topic
df = collect_topic_data(
keywords=["retrieval augmented generation", "RAG"],
max_results_per_keyword=100,
min_year=2020,
)
# Summarize the data
summary = summarize_topic_data(df)
print(f"Total papers: {summary['total_papers']}")
# Analyze trends
trends = analyze_topic_trends(df)
# Visualize publication trends
plot_topic_counts_by_year(trends, topic_name="RAG")
API Reference
Data Collection & Analysis
collect_topic_data()- Collect papers from Semantic Scholarsummarize_topic_data()- Generate summary statisticsanalyze_topic_trends()- Analyze per-year trends
Visualization
plot_topic_counts_by_year()- Plot publication counts over timeembed_and_plot_abstracts()- Create embedding visualizationsplot_landmark_timeline()- Plot timelines with landmark events
Examples
The package includes several example topics:
- RAG (Retrieval-Augmented Generation): Track the evolution of RAG research
- Chain-of-Thought Reasoning: Analyze reasoning capabilities in LLMs
- Multimodal Vision-Language Models: Study multimodal learning trends
- Transformer Architectures: Examine transformer model developments
Configuration
Set your Semantic Scholar API key:
export SEMANTIC_SCHOLAR_API_KEY="your_api_key_here"
Or create a .env file:
SEMANTIC_SCHOLAR_API_KEY=your_api_key_here
Dependencies
- pandas: Data manipulation
- requests: API calls
- matplotlib/seaborn: Plotting
- sentence-transformers: Text embeddings
- torch: Machine learning
- scikit-learn: Dimensionality reduction
- umap-learn: Embedding visualization
- plotly: Interactive plots
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ml_research_trends-0.1.1.tar.gz.
File metadata
- Download URL: ml_research_trends-0.1.1.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5089892dab3838d2a2263d38f59843226d247a2f7b9a9e10de6b376299c47515
|
|
| MD5 |
24ee2557defe34a93bebb6cb77c4c991
|
|
| BLAKE2b-256 |
bc61a65dc30f2df51c56717ce24b54ceb598a6949eb63026b31f5dfc16189c91
|
File details
Details for the file ml_research_trends-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ml_research_trends-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00fef07060929ca4399d4b1d0b60aeee388e04292dd7a1adeebc38a8ef796d41
|
|
| MD5 |
bc4eeb2232e79aae6825e43ff3e55fa1
|
|
| BLAKE2b-256 |
cd844899aec8a7361956e959914e8e6a4f61f0a7a1d3921a51d17b13663ae933
|