ads-bib 0.1.0__tar.gz
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.
- ads_bib-0.1.0/.gitattributes +7 -0
- ads_bib-0.1.0/.gitignore +79 -0
- ads_bib-0.1.0/.python-version +1 -0
- ads_bib-0.1.0/.zenodo.json +23 -0
- ads_bib-0.1.0/CHANGELOG.md +52 -0
- ads_bib-0.1.0/CITATION.cff +20 -0
- ads_bib-0.1.0/LICENSE +21 -0
- ads_bib-0.1.0/PKG-INFO +143 -0
- ads_bib-0.1.0/README.md +84 -0
- ads_bib-0.1.0/data/README.md +14 -0
- ads_bib-0.1.0/data/cache/.gitkeep +0 -0
- ads_bib-0.1.0/data/models/.gitkeep +0 -0
- ads_bib-0.1.0/data/raw/.gitkeep +0 -0
- ads_bib-0.1.0/docs/assets/topic_map.html +1194 -0
- ads_bib-0.1.0/pyproject.toml +124 -0
- ads_bib-0.1.0/runs/.gitkeep +0 -0
- ads_bib-0.1.0/runs/README.md +7 -0
- ads_bib-0.1.0/src/ads_bib/__init__.py +80 -0
- ads_bib-0.1.0/src/ads_bib/_dataset_bundle.py +266 -0
- ads_bib-0.1.0/src/ads_bib/_presets/hf_api.yaml +138 -0
- ads_bib-0.1.0/src/ads_bib/_presets/local_cpu.yaml +138 -0
- ads_bib-0.1.0/src/ads_bib/_presets/local_gpu.yaml +138 -0
- ads_bib-0.1.0/src/ads_bib/_presets/openrouter.yaml +138 -0
- ads_bib-0.1.0/src/ads_bib/_stage_state.py +376 -0
- ads_bib-0.1.0/src/ads_bib/_utils/__init__.py +0 -0
- ads_bib-0.1.0/src/ads_bib/_utils/ads_api.py +158 -0
- ads_bib-0.1.0/src/ads_bib/_utils/authors.py +31 -0
- ads_bib-0.1.0/src/ads_bib/_utils/checkpoints.py +176 -0
- ads_bib-0.1.0/src/ads_bib/_utils/cleaning.py +81 -0
- ads_bib-0.1.0/src/ads_bib/_utils/costs.py +117 -0
- ads_bib-0.1.0/src/ads_bib/_utils/hf_compat.py +151 -0
- ads_bib-0.1.0/src/ads_bib/_utils/huggingface_api.py +60 -0
- ads_bib-0.1.0/src/ads_bib/_utils/io.py +61 -0
- ads_bib-0.1.0/src/ads_bib/_utils/llama_server.py +903 -0
- ads_bib-0.1.0/src/ads_bib/_utils/logging.py +271 -0
- ads_bib-0.1.0/src/ads_bib/_utils/model_specs.py +91 -0
- ads_bib-0.1.0/src/ads_bib/_utils/openrouter_client.py +135 -0
- ads_bib-0.1.0/src/ads_bib/_utils/openrouter_costs.py +433 -0
- ads_bib-0.1.0/src/ads_bib/author_disambiguation.py +477 -0
- ads_bib-0.1.0/src/ads_bib/bootstrap.py +116 -0
- ads_bib-0.1.0/src/ads_bib/citations.py +1384 -0
- ads_bib-0.1.0/src/ads_bib/cli.py +252 -0
- ads_bib-0.1.0/src/ads_bib/config.py +109 -0
- ads_bib-0.1.0/src/ads_bib/curate.py +249 -0
- ads_bib-0.1.0/src/ads_bib/doctor.py +640 -0
- ads_bib-0.1.0/src/ads_bib/export.py +340 -0
- ads_bib-0.1.0/src/ads_bib/notebook.py +252 -0
- ads_bib-0.1.0/src/ads_bib/pipeline.py +1988 -0
- ads_bib-0.1.0/src/ads_bib/presets.py +75 -0
- ads_bib-0.1.0/src/ads_bib/prompts.py +105 -0
- ads_bib-0.1.0/src/ads_bib/run_manager.py +375 -0
- ads_bib-0.1.0/src/ads_bib/runner.py +268 -0
- ads_bib-0.1.0/src/ads_bib/search.py +173 -0
- ads_bib-0.1.0/src/ads_bib/tokenize.py +204 -0
- ads_bib-0.1.0/src/ads_bib/topic_model/__init__.py +28 -0
- ads_bib-0.1.0/src/ads_bib/topic_model/_runtime.py +34 -0
- ads_bib-0.1.0/src/ads_bib/topic_model/backends.py +2414 -0
- ads_bib-0.1.0/src/ads_bib/topic_model/embeddings.py +823 -0
- ads_bib-0.1.0/src/ads_bib/topic_model/input.py +40 -0
- ads_bib-0.1.0/src/ads_bib/topic_model/output.py +124 -0
- ads_bib-0.1.0/src/ads_bib/topic_model/reduction.py +246 -0
- ads_bib-0.1.0/src/ads_bib/translate.py +1457 -0
- ads_bib-0.1.0/src/ads_bib/visualize.py +1448 -0
- ads_bib-0.1.0/uv.lock +3641 -0
- ads_bib-0.1.0/zensical.toml +77 -0
ads_bib-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Data and run artifacts (keep folder skeleton, ignore contents)
|
|
2
|
+
data/**
|
|
3
|
+
!data/
|
|
4
|
+
!data/README.md
|
|
5
|
+
!data/raw/
|
|
6
|
+
data/raw/**
|
|
7
|
+
!data/raw/.gitkeep
|
|
8
|
+
!data/cache/
|
|
9
|
+
data/cache/**
|
|
10
|
+
!data/cache/.gitkeep
|
|
11
|
+
!data/models/
|
|
12
|
+
data/models/**
|
|
13
|
+
!data/models/.gitkeep
|
|
14
|
+
|
|
15
|
+
runs/**
|
|
16
|
+
!runs/
|
|
17
|
+
!runs/README.md
|
|
18
|
+
!runs/.gitkeep
|
|
19
|
+
|
|
20
|
+
# Environment
|
|
21
|
+
.env
|
|
22
|
+
*.env
|
|
23
|
+
.venv/
|
|
24
|
+
.claude/
|
|
25
|
+
|
|
26
|
+
# Maintainer-only backlog (optional local file; not versioned)
|
|
27
|
+
AGENTS.md
|
|
28
|
+
Package_ToDo.md
|
|
29
|
+
|
|
30
|
+
# Python
|
|
31
|
+
__pycache__/
|
|
32
|
+
*.py[cod]
|
|
33
|
+
*$py.class
|
|
34
|
+
.pytest_cache/
|
|
35
|
+
.ruff_cache/
|
|
36
|
+
.coverage
|
|
37
|
+
.coverage.*
|
|
38
|
+
htmlcov/
|
|
39
|
+
*.egg-info/
|
|
40
|
+
dist/
|
|
41
|
+
build/
|
|
42
|
+
site/
|
|
43
|
+
.cache/
|
|
44
|
+
*.egg
|
|
45
|
+
|
|
46
|
+
# Jupyter
|
|
47
|
+
.ipynb_checkpoints/
|
|
48
|
+
|
|
49
|
+
# Local test/debug artifacts
|
|
50
|
+
_test_run_dir/
|
|
51
|
+
tmp_native_capture*.log
|
|
52
|
+
tmp/
|
|
53
|
+
|
|
54
|
+
# OS
|
|
55
|
+
.DS_Store
|
|
56
|
+
Thumbs.db
|
|
57
|
+
desktop.ini
|
|
58
|
+
NUL
|
|
59
|
+
|
|
60
|
+
# IDE
|
|
61
|
+
.vscode/
|
|
62
|
+
.cursor/
|
|
63
|
+
.idea/
|
|
64
|
+
*.swp
|
|
65
|
+
*.swo
|
|
66
|
+
|
|
67
|
+
# Models & caches
|
|
68
|
+
*.bin
|
|
69
|
+
*.pkl
|
|
70
|
+
*.npz
|
|
71
|
+
*.npy
|
|
72
|
+
*.safetensors
|
|
73
|
+
|
|
74
|
+
# Large outputs
|
|
75
|
+
*.html
|
|
76
|
+
!docs/assets/topic_map.html
|
|
77
|
+
*.db
|
|
78
|
+
*.xlsx
|
|
79
|
+
filtered_publications.xlsx
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "ads-bib: Pipeline for Curated Bibliometric Datasets from NASA ADS",
|
|
3
|
+
"upload_type": "software",
|
|
4
|
+
"description": "ads-bib is a Python package and command-line pipeline for constructing curated bibliometric datasets from NASA Astrophysics Data System (ADS) searches. It automates publication retrieval, reference normalization, translation, tokenization, author name disambiguation, embedding-based topic modeling, citation-network export, and topic-map generation. The package provides runtime presets for local CPU/GPU and API-backed workflows, producing self-contained run directories with tabular datasets, provenance metadata, plots, and network files for downstream analysis.",
|
|
5
|
+
"creators": [
|
|
6
|
+
{
|
|
7
|
+
"name": "Schlattmann, Raphael"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"version": "0.1.0",
|
|
11
|
+
"publication_date": "2026-04-28",
|
|
12
|
+
"license": "mit",
|
|
13
|
+
"language": "eng",
|
|
14
|
+
"access_right": "open",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"topic-modeling",
|
|
17
|
+
"digital-humanities",
|
|
18
|
+
"bibliometrics",
|
|
19
|
+
"publication-metadata",
|
|
20
|
+
"dataset-curation",
|
|
21
|
+
"citation-networks"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on Keep a Changelog, and this project follows Semantic Versioning.
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.1.0] - 2026-04-28
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- Shared package runner in `ads_bib.pipeline` with structured `PipelineConfig`, named stages, and reusable stage functions.
|
|
13
|
+
- Thin CLI batch entrypoint: `ads-bib run --config ...` with optional `--from`, `--to`, `--run-name`, and `--set` overrides.
|
|
14
|
+
- Notebook adapter in `ads_bib.notebook` with `NotebookSession` and package-side config invalidation.
|
|
15
|
+
- Native `huggingface_api` translation path via `huggingface_hub.AsyncInferenceClient`.
|
|
16
|
+
- Official packaged runtime presets exposed via `ads-bib run --preset ...` and `ads-bib preset write ...`.
|
|
17
|
+
- Workspace bootstrap and stage-aware doctor commands for first-run setup and preflight validation.
|
|
18
|
+
- Offline HF provider smoke coverage plus env-gated live HF smoke tests for translation, embeddings, and BERTopic labeling.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- Base `ads-bib` installs now own the official runtime stack; only non-default algorithm overrides remain behind the `umap` and `hdbscan` extras.
|
|
22
|
+
- Pin `datamapplot` to `>=0.6.4,<0.7`: 0.7.x changed the `selection_handlers` layout and breaks `ads_bib.visualize` until imports are updated.
|
|
23
|
+
- GitHub Actions now install only the active base contract plus `test`, `umap`, and `hdbscan`; removed references to historical extras and install profiles.
|
|
24
|
+
- `pipeline.ipynb` now uses explicit section dicts plus `NotebookSession`; it no longer owns config assembly, invalidation, `globals()` syncing, or `START_STAGE` / `STOP_STAGE`.
|
|
25
|
+
- Stage slicing remains a CLI/YAML concern; notebook reruns are driven by executing the corresponding stage cell.
|
|
26
|
+
- Notebook stage cells are now strict and no longer auto-chain earlier stages such as `translate -> export`.
|
|
27
|
+
- Fresh in-memory notebook state now takes precedence over same-stage translated/tokenized/disambiguated snapshots when a config change invalidates later stages.
|
|
28
|
+
- Run config snapshots are now serialized from structured pipeline config instead of raw notebook globals.
|
|
29
|
+
- Prompt selection now supports `topic_model.llm_prompt_name` with package-side resolution and `.env` fallbacks for ADS/OpenRouter secrets.
|
|
30
|
+
- Tokenization defaults now use `en_core_web_md` rather than `en_core_web_lg`.
|
|
31
|
+
- AND integration remains optional, but the active path is now the source-based external adapter rather than a placeholder notebook contract.
|
|
32
|
+
- `run_pipeline()` remains the dependency-aware batch path; notebook stage execution now has intentionally different UX semantics.
|
|
33
|
+
- Runtime output is now frontend-aware: CLI runs use compact stage-first console output, notebook runs stay slightly more explanatory, and raw third-party stdout/stderr is redirected into `runs/<run_id>/logs/runtime.log`.
|
|
34
|
+
- Nested progress-bar noise was reduced so normal runs show at most one primary progress bar per stage.
|
|
35
|
+
- `huggingface_api` embeddings now use the native Hugging Face async client instead of LiteLLM, while BERTopic labeling keeps BERTopic's LiteLLM adapter with normalized HF-native model ids.
|
|
36
|
+
- Pipeline config preparation now injects `HF_TOKEN` into translation, embedding, and BERTopic labeling configs when `huggingface_api` is selected.
|
|
37
|
+
- CLI runs now persist `run_summary.yaml` just like notebook runs, including partial/failure status metadata.
|
|
38
|
+
- OpenRouter and Hugging Face chat translation now share the same centralized scientific translation prompt contract.
|
|
39
|
+
- Official runtime roads now ship as four packaged generic presets accessed via CLI rather than repo-root YAML files.
|
|
40
|
+
- Stable local presets now pin only GGUF model families that are validated against the baseline `ADS_env` runtime; the CPU labeling preset uses `Qwen/Qwen2.5-0.5B-Instruct-GGUF` instead of unsupported `qwen35` variants.
|
|
41
|
+
- Base runtime dependencies now include the provider and topic stack needed by the four official roads; `huggingface-hub` remains part of that default install.
|
|
42
|
+
- Hugging Face API key resolution now accepts `HF_TOKEN`, `HF_API_KEY`, and `HUGGINGFACE_API_KEY`.
|
|
43
|
+
- Core runtime dependencies now include `pyarrow` and `networkx`, and translation now validates the `openai` dependency for OpenRouter before execution.
|
|
44
|
+
- Packaging extras no longer expose the obsolete `translate-local` / `translate-api` names; the remaining extras are `test`, `umap`, and `hdbscan`.
|
|
45
|
+
|
|
46
|
+
### Docs
|
|
47
|
+
- Site configuration lives at `zensical.toml` in the repository root; build and preview use `zensical ...` from the root (including GitHub Actions).
|
|
48
|
+
- `Package_ToDo.md` remains maintainer-local; repository cleanup no longer depends on a versioned backlog file in the public tree.
|
|
49
|
+
- Removed `CLAUDE.md`; repository engineering rules and conventions live in `AGENTS.md` only.
|
|
50
|
+
- Public docs and metadata now position the installed package and CLI as the primary runtime path, with `pipeline.ipynb` documented as an optional GitHub companion.
|
|
51
|
+
- `AGENTS.md` architecture notes now record the notebook-session adapter and the source-based AND step.
|
|
52
|
+
- README/runtime docs now document `ads-bib run` as the happy path, keep `bootstrap` and `doctor` as support commands, and treat `huggingface_api` as a full official road across both topic backends.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use this software, please cite it using the metadata below."
|
|
3
|
+
title: "ads-bib: Pipeline for Curated Bibliometric Datasets from NASA ADS"
|
|
4
|
+
type: software
|
|
5
|
+
version: "0.1.0"
|
|
6
|
+
date-released: "2026-04-28"
|
|
7
|
+
license: MIT
|
|
8
|
+
abstract: "ads-bib is a Python package and command-line pipeline for constructing curated bibliometric datasets from NASA Astrophysics Data System (ADS) searches. It automates publication retrieval, reference normalization, translation, tokenization, author name disambiguation, embedding-based topic modeling, citation-network export, and topic-map generation. The package provides runtime presets for local CPU/GPU and API-backed workflows, producing self-contained run directories with tabular datasets, provenance metadata, plots, and network files for downstream analysis."
|
|
9
|
+
keywords:
|
|
10
|
+
- topic-modeling
|
|
11
|
+
- digital-humanities
|
|
12
|
+
- bibliometrics
|
|
13
|
+
- publication-metadata
|
|
14
|
+
- dataset-curation
|
|
15
|
+
- citation-networks
|
|
16
|
+
authors:
|
|
17
|
+
- family-names: Schlattmann
|
|
18
|
+
given-names: Raphael
|
|
19
|
+
repository-code: "https://github.com/raphschlatt/ads-bib"
|
|
20
|
+
url: "https://github.com/raphschlatt/ads-bib"
|
ads_bib-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ADS Pipeline contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
ads_bib-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ads-bib
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Pipeline for querying and turning NASA's ADS publications metadata into curated, analysis-ready datasets, topic maps, and citation networks.
|
|
5
|
+
Project-URL: Homepage, https://github.com/raphschlatt/ads-bib
|
|
6
|
+
Project-URL: Documentation, https://raphschlatt.github.io/ads-bib/
|
|
7
|
+
Project-URL: Repository, https://github.com/raphschlatt/ads-bib
|
|
8
|
+
Project-URL: Issues, https://github.com/raphschlatt/ads-bib/issues
|
|
9
|
+
Author: Raphael Schlattmann
|
|
10
|
+
Maintainer: Raphael Schlattmann
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: bibliometrics,citation-networks,dataset-curation,digital-humanities,publication-metadata,topic-modeling
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
20
|
+
Requires-Python: <3.13,>=3.12
|
|
21
|
+
Requires-Dist: accelerate>=1.0
|
|
22
|
+
Requires-Dist: ads-and[cpu-onnx,modal]<0.2,>=0.1.3
|
|
23
|
+
Requires-Dist: bertopic
|
|
24
|
+
Requires-Dist: ctranslate2
|
|
25
|
+
Requires-Dist: dask
|
|
26
|
+
Requires-Dist: datamapplot<0.7,>=0.6.4
|
|
27
|
+
Requires-Dist: fast-hdbscan<0.3,>=0.2.2
|
|
28
|
+
Requires-Dist: fasttext-wheel
|
|
29
|
+
Requires-Dist: huggingface-hub
|
|
30
|
+
Requires-Dist: litellm
|
|
31
|
+
Requires-Dist: matplotlib
|
|
32
|
+
Requires-Dist: networkx
|
|
33
|
+
Requires-Dist: numpy>=1.24
|
|
34
|
+
Requires-Dist: openai
|
|
35
|
+
Requires-Dist: pacmap
|
|
36
|
+
Requires-Dist: pandas>=2.0
|
|
37
|
+
Requires-Dist: pyarrow
|
|
38
|
+
Requires-Dist: python-dotenv
|
|
39
|
+
Requires-Dist: pyyaml
|
|
40
|
+
Requires-Dist: requests
|
|
41
|
+
Requires-Dist: scikit-learn
|
|
42
|
+
Requires-Dist: scipy>=1.10
|
|
43
|
+
Requires-Dist: seaborn
|
|
44
|
+
Requires-Dist: sentence-transformers>=5.1
|
|
45
|
+
Requires-Dist: sentencepiece
|
|
46
|
+
Requires-Dist: spacy>=3.7
|
|
47
|
+
Requires-Dist: toponymy==0.4.0
|
|
48
|
+
Requires-Dist: torch<2.7,>=2.6
|
|
49
|
+
Requires-Dist: tqdm
|
|
50
|
+
Requires-Dist: transformers<4.57,>=4.56
|
|
51
|
+
Provides-Extra: hdbscan
|
|
52
|
+
Requires-Dist: hdbscan; extra == 'hdbscan'
|
|
53
|
+
Provides-Extra: test
|
|
54
|
+
Requires-Dist: pytest>=7; extra == 'test'
|
|
55
|
+
Requires-Dist: ruff>=0.6; extra == 'test'
|
|
56
|
+
Provides-Extra: umap
|
|
57
|
+
Requires-Dist: umap-learn; extra == 'umap'
|
|
58
|
+
Description-Content-Type: text/markdown
|
|
59
|
+
|
|
60
|
+
# ads-bib
|
|
61
|
+
|
|
62
|
+

|
|
63
|
+

|
|
64
|
+
[](https://raphschlatt.github.io/ads-bib/)
|
|
65
|
+
[](https://colab.research.google.com/github/raphschlatt/ads-bib/blob/main/pipeline.ipynb)
|
|
66
|
+
|
|
67
|
+
`ads-bib` takes a NASA ADS search query and produces a normalized, curated dataset, with disambiguated author names (AND via [ads-and](https://github.com/raphschlatt/ads-and)), topic models (via [BERTopic](https://maartengr.github.io/BERTopic/) or [Toponymy](https://github.com/TutteInstitute/toponymy)), and citation networks ready for e.g. [Gephi](https://gephi.org/), [CiteSpace](http://cluster.cis.drexel.edu/~cchen/citespace/), or [VOSviewer](https://www.vosviewer.com/), locally or via API.
|
|
68
|
+
|
|
69
|
+
## Installation
|
|
70
|
+
|
|
71
|
+
Use [uv](https://docs.astral.sh/uv/) and Python 3.12.
|
|
72
|
+
```bash
|
|
73
|
+
uv pip install ads-bib
|
|
74
|
+
# or: pip install ads-bib
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Quick Start
|
|
78
|
+
|
|
79
|
+
Create a `.env` file in your project root with the relevant API keys.
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
ADS_TOKEN=your-ads-token # required
|
|
83
|
+
OPENROUTER_API_KEY=your-key # only for the openrouter road
|
|
84
|
+
HF_TOKEN=your-key # only for the huggingface road
|
|
85
|
+
MODAL_TOKEN_ID=your-modal-id # only for AND with backend=modal
|
|
86
|
+
MODAL_TOKEN_SECRET=your-modal-secret
|
|
87
|
+
```
|
|
88
|
+
[ADS user token settings](https://ui.adsabs.harvard.edu/user/settings/token) | [OpenRouter Keys](https://openrouter.ai/settings/keys) | [Hugging Face Access Tokens](https://huggingface.co/settings/tokens) | [Modal](https://modal.com/).
|
|
89
|
+
|
|
90
|
+
Then run in your terminal:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
ads-bib run --preset openrouter --set search.query='author:"Hawking, S*"'
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Author name disambiguation is off by default. Enable the local CPU/GPU path
|
|
97
|
+
with `--set author_disambiguation.enabled=true`; use
|
|
98
|
+
`--set author_disambiguation.backend=modal` only when your Modal credentials are
|
|
99
|
+
configured.
|
|
100
|
+
|
|
101
|
+
Full setup details: [Get Started](https://raphschlatt.github.io/ads-bib/get-started/) | [Runtime Roads](https://raphschlatt.github.io/ads-bib/runtime-roads/)
|
|
102
|
+
|
|
103
|
+
## Python API
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
import ads_bib
|
|
107
|
+
|
|
108
|
+
ads_bib.run(
|
|
109
|
+
preset="openrouter",
|
|
110
|
+
query='author:"Hawking, S*"',
|
|
111
|
+
)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
More examples and the `NotebookSession` interface: [Python API docs](https://raphschlatt.github.io/ads-bib/python-api/)
|
|
115
|
+
|
|
116
|
+
## Pick a Runtime Road
|
|
117
|
+
|
|
118
|
+
| Road | Hardware | Network | Cost |
|
|
119
|
+
| --- | --- | --- | --- |
|
|
120
|
+
| `openrouter` | any | API calls | pay-per-token |
|
|
121
|
+
| `hf_api` | any | API calls | HF-plan-dependent |
|
|
122
|
+
| `local_cpu` | CPU only | model downloads only | free after setup |
|
|
123
|
+
| `local_gpu` | NVIDIA + CUDA | model downloads only | free after setup |
|
|
124
|
+
|
|
125
|
+
Full provider matrix and first-run behavior: [Runtime Roads](https://raphschlatt.github.io/ads-bib/runtime-roads/)
|
|
126
|
+
|
|
127
|
+
## Output
|
|
128
|
+
|
|
129
|
+
Each run produces a self-contained output directory:
|
|
130
|
+
|
|
131
|
+
- **`publications.parquet`** — cleaned, translated, topic-labeled publications, with disambiguated authors when AND is enabled
|
|
132
|
+
- **`references.parquet`** — normalized cited-reference metadata, with disambiguated authors when AND is enabled
|
|
133
|
+
- **`topic_info.parquet`** — one row per topic with labels, counts, and representation fields
|
|
134
|
+
- **`topic_map.html`** — interactive topic visualization (open in any browser), using [datamapplot](https://github.com/TutteInstitute/datamapplot)
|
|
135
|
+
- **`.gexf` citation networks** — direct citation, co-citation, bibliographic coupling, author co-citation
|
|
136
|
+
- **`download_wos_export.txt`** — Web of Science format for e.g. [CiteSpace](https://citespace.podia.com/) / [VOSviewer](https://www.vosviewer.com/)
|
|
137
|
+
- **`run_summary.yaml`** — full run metadata and stage timings
|
|
138
|
+
|
|
139
|
+
[](https://github.com/TutteInstitute/datamapplot)
|
|
140
|
+
*Topic map output from `author:"Hawking, S*"` in [datamapplot](https://github.com/TutteInstitute/datamapplot).*
|
|
141
|
+
|
|
142
|
+
[](https://gephi.org/gephi-lite/)
|
|
143
|
+
*Author co-citation output from `author:"Hawking, S*"` in [Gephi Lite](https://gephi.org/gephi-lite/).*
|
ads_bib-0.1.0/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# ads-bib
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+
[](https://raphschlatt.github.io/ads-bib/)
|
|
6
|
+
[](https://colab.research.google.com/github/raphschlatt/ads-bib/blob/main/pipeline.ipynb)
|
|
7
|
+
|
|
8
|
+
`ads-bib` takes a NASA ADS search query and produces a normalized, curated dataset, with disambiguated author names (AND via [ads-and](https://github.com/raphschlatt/ads-and)), topic models (via [BERTopic](https://maartengr.github.io/BERTopic/) or [Toponymy](https://github.com/TutteInstitute/toponymy)), and citation networks ready for e.g. [Gephi](https://gephi.org/), [CiteSpace](http://cluster.cis.drexel.edu/~cchen/citespace/), or [VOSviewer](https://www.vosviewer.com/), locally or via API.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
Use [uv](https://docs.astral.sh/uv/) and Python 3.12.
|
|
13
|
+
```bash
|
|
14
|
+
uv pip install ads-bib
|
|
15
|
+
# or: pip install ads-bib
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
Create a `.env` file in your project root with the relevant API keys.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
ADS_TOKEN=your-ads-token # required
|
|
24
|
+
OPENROUTER_API_KEY=your-key # only for the openrouter road
|
|
25
|
+
HF_TOKEN=your-key # only for the huggingface road
|
|
26
|
+
MODAL_TOKEN_ID=your-modal-id # only for AND with backend=modal
|
|
27
|
+
MODAL_TOKEN_SECRET=your-modal-secret
|
|
28
|
+
```
|
|
29
|
+
[ADS user token settings](https://ui.adsabs.harvard.edu/user/settings/token) | [OpenRouter Keys](https://openrouter.ai/settings/keys) | [Hugging Face Access Tokens](https://huggingface.co/settings/tokens) | [Modal](https://modal.com/).
|
|
30
|
+
|
|
31
|
+
Then run in your terminal:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
ads-bib run --preset openrouter --set search.query='author:"Hawking, S*"'
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Author name disambiguation is off by default. Enable the local CPU/GPU path
|
|
38
|
+
with `--set author_disambiguation.enabled=true`; use
|
|
39
|
+
`--set author_disambiguation.backend=modal` only when your Modal credentials are
|
|
40
|
+
configured.
|
|
41
|
+
|
|
42
|
+
Full setup details: [Get Started](https://raphschlatt.github.io/ads-bib/get-started/) | [Runtime Roads](https://raphschlatt.github.io/ads-bib/runtime-roads/)
|
|
43
|
+
|
|
44
|
+
## Python API
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
import ads_bib
|
|
48
|
+
|
|
49
|
+
ads_bib.run(
|
|
50
|
+
preset="openrouter",
|
|
51
|
+
query='author:"Hawking, S*"',
|
|
52
|
+
)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
More examples and the `NotebookSession` interface: [Python API docs](https://raphschlatt.github.io/ads-bib/python-api/)
|
|
56
|
+
|
|
57
|
+
## Pick a Runtime Road
|
|
58
|
+
|
|
59
|
+
| Road | Hardware | Network | Cost |
|
|
60
|
+
| --- | --- | --- | --- |
|
|
61
|
+
| `openrouter` | any | API calls | pay-per-token |
|
|
62
|
+
| `hf_api` | any | API calls | HF-plan-dependent |
|
|
63
|
+
| `local_cpu` | CPU only | model downloads only | free after setup |
|
|
64
|
+
| `local_gpu` | NVIDIA + CUDA | model downloads only | free after setup |
|
|
65
|
+
|
|
66
|
+
Full provider matrix and first-run behavior: [Runtime Roads](https://raphschlatt.github.io/ads-bib/runtime-roads/)
|
|
67
|
+
|
|
68
|
+
## Output
|
|
69
|
+
|
|
70
|
+
Each run produces a self-contained output directory:
|
|
71
|
+
|
|
72
|
+
- **`publications.parquet`** — cleaned, translated, topic-labeled publications, with disambiguated authors when AND is enabled
|
|
73
|
+
- **`references.parquet`** — normalized cited-reference metadata, with disambiguated authors when AND is enabled
|
|
74
|
+
- **`topic_info.parquet`** — one row per topic with labels, counts, and representation fields
|
|
75
|
+
- **`topic_map.html`** — interactive topic visualization (open in any browser), using [datamapplot](https://github.com/TutteInstitute/datamapplot)
|
|
76
|
+
- **`.gexf` citation networks** — direct citation, co-citation, bibliographic coupling, author co-citation
|
|
77
|
+
- **`download_wos_export.txt`** — Web of Science format for e.g. [CiteSpace](https://citespace.podia.com/) / [VOSviewer](https://www.vosviewer.com/)
|
|
78
|
+
- **`run_summary.yaml`** — full run metadata and stage timings
|
|
79
|
+
|
|
80
|
+
[](https://github.com/TutteInstitute/datamapplot)
|
|
81
|
+
*Topic map output from `author:"Hawking, S*"` in [datamapplot](https://github.com/TutteInstitute/datamapplot).*
|
|
82
|
+
|
|
83
|
+
[](https://gephi.org/gephi-lite/)
|
|
84
|
+
*Author co-citation output from `author:"Hawking, S*"` in [Gephi Lite](https://gephi.org/gephi-lite/).*
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Data Directory
|
|
2
|
+
|
|
3
|
+
This repository tracks only the `data/` folder structure.
|
|
4
|
+
|
|
5
|
+
Ignored on purpose:
|
|
6
|
+
- raw datasets
|
|
7
|
+
- caches
|
|
8
|
+
- model binaries
|
|
9
|
+
- generated intermediate files
|
|
10
|
+
|
|
11
|
+
Use this structure locally:
|
|
12
|
+
- `data/raw/`
|
|
13
|
+
- `data/cache/`
|
|
14
|
+
- `data/models/`
|
|
File without changes
|
|
File without changes
|
|
File without changes
|