🚀 OneCite
OneCiteは、汚雑で非構造化された参考文献を、完全に整形された標準的な引用形式に簡単に変換することができるツールです。強力なコマンドラインツールおよびPythonライブラリであり、引用管理の面倒な作業を自動化します。DOI、論文タイトル、arXiv ID、またはそれらの混合形式を入力すると、きれいで正確な書誌事項を返します。
🚀 クイックスタート
OneCiteを1分以内に使い始めることができます。
インストール
pip install onecite
git clone https://github.com/HzaCode/OneCite.git
cd OneCite
pip install -e .
基本的な使用法
- 入力ファイル (
references.txt) を作成し、様々な引用形式を混在させます。10.1038/nature14539
Attention is all you need, Vaswani et al., NIPS 2017
Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep Learning. MIT Press.
https://github.com/tensorflow/tensorflow
10.5281/zenodo.3233118
arXiv:2103.00020
Smith, J. (2020). Neural Architecture Search. PhD Thesis. Stanford University.
- コマンドを実行します。
onecite process references.txt -o results.bib --quiet
- 完全に整形された出力 (
results.bib) を取得します。7種類の異なる形式が含まれています。
📄 完全な出力を表示 (results.bib)
@article{LeCun2015Deep,
doi = "10.1038/nature14539",
title = "Deep learning",
author = "LeCun, Yann and Bengio, Yoshua and Hinton, Geoffrey",
journal = "Nature",
year = 2015,
volume = 521,
number = 7553,
pages = "436-444",
publisher = "Springer Science and Business Media LLC",
url = "https://doi.org/10.1038/nature14539",
type = "journal-article",
}
@inproceedings{Vaswani2017Attention,
arxiv = "1706.03762",
title = "Attention Is All You Need",
author = "Vaswani, Ashish and Shazeer, Noam and Parmar, Niki and Uszkoreit, Jakob and Jones, Llion and Gomez, Aidan N. and Kaiser, Lukasz and Polosukhin, Illia",
year = 2017,
journal = "arXiv preprint",
url = "https://arxiv.org/abs/1706.03762",
}
@book{Goodfellow2016Deep,
title = "Deep Learning",
author = "Ian Goodfellow and Yoshua Bengio and Aaron Courville",
publisher = "MIT Press",
year = 2016,
isbn = "9780262337373",
url = "https://play.google.com/store/books/details?id=omivDQAAQBAJ&source=gbs_api",
pages = "801",
}
@software{tensorflow2015tensorflow,
title = "tensorflow",
author = "tensorflow",
publisher = "GitHub",
year = 2015,
version = "2.20.0",
url = "https://github.com/tensorflow/tensorflow",
}
@misc{Brett2019nipynibabel,
title = "nipy/nibabel: 2.4.1",
author = "Brett, Matthew and Markiewicz, Christopher J. and Hanke, Michael and Côté, Marc-Alexandre and Cipollini, Ben and McCarthy, Paul and Cheng, Christopher P. and Halchenko, Yaroslav O. and Cottaar, Michiel and Ghosh, Satrajit and Larson, Eric and Wassermann, Demian and Gerhard, Stephan and Lee, Gregory R. and Kastman, Erik and Rokem, Ariel and Madison, Cindee and Morency, Félix C. and Moloney, Brendan and Burns, Christopher and Millman, Jarrod and Gramfort, Alexandre and Leppäkangas, Jaakko and Markello, Ross and van den Bosch, Jasper J.F. and Vincent, Robert D. and Subramaniam, Krish and Raamana, Pradeep Reddy and Nichols, B. Nolan and Baker, Eric M. and Goncalves, Mathias and Hayashi, Soichi and Pinsard, Basile and Haselgrove, Christian and Hymers, Mark and Koudoro, Serge and Oosterhof, Nikolaas N. and Amirbekian, Bago and Nimmo-Smith, Ian and Nguyen, Ly and Reddigari, Samir and St-Jean, Samuel and Garyfallidis, Eleftherios and Varoquaux, Gael and Kaczmarzyk, Jakub and Legarreta, Jon Haitz and Hahn, Kevin S. and Hinds, Oliver P. and Fauber, Bennet and Poline, Jean-Baptiste and Stutters, Jon and Jordan, Kesshi and Cieslak, Matthew and Moreno, Miguel Estevan and Haenel, Valentin and Schwartz, Yannick and Thirion, Bertrand and Papadopoulos Orfanos, Dimitri and Pérez-García, Fernando and Solovey, Igor and Gonzalez, Ivan and Lecher, Justin and Leinweber, Katrin and Raktivan, Konstantinos and Fischer, Peter and Gervais, Philippe and Gadde, Syam and Ballinger, Thomas and Roos, Thomas and Reddam, Venkateswara Reddy and freec84",
year = 2019,
howpublished = "Zenodo",
url = "https://zenodo.org/record/3233118",
version = "2.4.1",
doi = "10.5281/zenodo.3233118",
}
@article{Radford2021Learning,
arxiv = "2103.00020",
title = "Learning Transferable Visual Models From Natural Language Supervision",
author = "Radford, Alec and Kim, Jong Wook and Hallacy, Chris and Ramesh, Aditya and Goh, Gabriel and Agarwal, Sandhini and Sastry, Girish and Askell, Amanda and Mishkin, Pamela and Clark, Jack and Krueger, Gretchen and Sutskever, Ilya",
year = 2021,
journal = "arXiv preprint",
url = "https://arxiv.org/abs/2103.00020",
}
@phdthesis{Smith2020Neural,
title = "Neural Architecture Search",
author = "Smith, J.",
school = "Stanford University",
year = 2020,
type = "phdthesis",
}
✨ 主な機能
- 🔍 スマート認識:複数の学術データベースに対してファジーマッチングを行い、不完全または不正確な情報から参考文献を見つけます。
- 📚 汎用フォーマットサポート:入力
.txt/.bib → 出力 BibTeX、APA、または MLA
- 🎯 高精度パイプライン:4段階の処理 (クリーン → クエリ → 検証 → 整形) で品質の高い出力を保証します。
- 🤖 自動補完:欠落しているデータ (雑誌名、巻号、ページ、ISBN、著者) を自動的に補填します。
- 🎓 7種類以上の引用タイプ:学術論文、会議論文、書籍、ソフトウェア、データセット、学位論文、プレプリント
- 🧠 インテリジェントルーティング:コンテンツのタイプとドメイン (医学/コンピュータサイエンス/一般) を自動検出し、最適なデータ取得を行います。
- 📄 汎用識別子:DOI、PMID、arXiv ID、ISBN、GitHub URL、Zenodo DOI、または平文
- 🎛️ インタラクティブモード:複数のマッチが見つかった場合に手動選択が可能です。
- ⚙️ カスタマイズ可能なテンプレート:YAMLベースのテンプレートシステムで出力を完全に制御できます。
🌐 データソース
💻 使用例
基本的な使用法
pip install onecite
git clone https://github.com/HzaCode/OneCite.git
cd OneCite
pip install -e .
高度な使用法
🎨 複数の出力形式 (APA, MLA)
onecite process refs.txt --output-format apa
onecite process refs.txt --output-format mla
🤖 インタラクティブな曖昧さ解消
曖昧なエントリの場合、--interactive フラグを使用して精度を確保します。
コマンド:
onecite process ambiguous.txt --interactive
例の対話:
1. Deep learning
Authors: LeCun, Yann; Bengio, Yoshua; Hinton, Geoffrey
Journal: Nature
Year: 2015
Match Score: 92.5
DOI: 10.1038/nature14539
2. Deep belief networks
Authors: Hinton, Geoffrey E.
Journal: Scholarpedia
Year: 2009
Match Score: 78.3
DOI: 10.4249/scholarpedia.5947
Please select (1-2, 0=skip): 1
✅ Selected: Deep learning
🐍 Pythonライブラリとして使用
OneCiteの処理機能を直接Pythonスクリプトに統合します。
from onecite import process_references
def auto_select_callback(candidates):
return 0
result = process_references(
input_content="Deep learning review\nLeCun, Bengio, Hinton\nNature 2015",
input_type="txt",
output_format="bibtex",
interactive_callback=auto_select_callback
)
print(result['output_content'])
📑 サポートされる入力例
# DOI
10.1038/nature14539
# 会議論文
Attention is all you need, Vaswani et al., NIPS 2017
# arXiv
1706.03762
https://arxiv.org/abs/1706.03762
# 書籍
Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep Learning. MIT Press.
Russell, S., & Norvig, P. (2021). Artificial Intelligence. ISBN: 978-0-13-604259-4.
# ソフトウェア
https://github.com/tensorflow/tensorflow
# データセット
10.5281/zenodo.3233118
# 学位論文
Smith, J. (2020). Deep Learning for Computer Vision. PhD Thesis. MIT.
# PubMed
PMID: 27225100
🤖 AIアシスタント統合 (MCP)
OneCiteは、完全なモデルコンテキストプロトコル (MCP) をサポートしており、AIアシスタントがOneCiteの機能を直接使用して文献検索、処理、および整形を行うことができます。
🚀 セットアップと設定
インストールとテスト
pip install onecite
onecite-mcp
AIアシスタントの設定
MCP対応のエディタの settings.json に追加します。
{
"mcpServers": {
"onecite": {
"command": "onecite-mcp",
"args": [],
"env": {}
}
}
}
エディタを再起動してOneCiteの統合を有効にします。
利用可能な関数
cite - 単一の引用を生成 (DOI、タイトル、arXiv ID → APA/MLA/BibTeX)
batch_cite - 複数の参考文献を一度に処理
search - キーワードで学術文献を検索
使用例
設定後、AIアシスタントに以下のように指示します。
- "DOI: 10.1038/nature14539のAPA形式の引用を生成して"
- "これらの参考文献をBibTeX形式で一括処理して"
- "機械学習に関する論文を検索して"
🔧 技術詳細
コマンドラインオプション
📋 コマンドラインオプション
| オプション |
説明 |
デフォルト |
--input-type |
入力形式 (txt, bib) |
txt |
--output-format |
出力形式 (bibtex, apa, mla) |
bibtex |
--template |
使用するカスタムテンプレートYAMLを指定 |
journal_article_full |
--interactive |
曖昧さ解消のためのインタラクティブモードを有効にする |
False |
--quiet |
詳細なログを抑制 |
False |
--output, -o |
出力ファイルのパス |
stdout |
カスタムテンプレート
🎨 カスタムテンプレート
簡単なYAMLテンプレートを使用してカスタム出力形式を定義します。
例 my_template.yaml:
name: my_template
entry_type: "@article"
fields:
- name: author
required: true
- name: title
required: true
- name: journal
required: true
- name: year
required: true
- name: doi
required: false
source_priority: [crossref_api]
使用法:
onecite process refs.txt --template my_template.yaml
🤝 コントリビューション
コントリビューションは大歓迎です!開発ガイドラインとプルリクエストの提出方法については、CONTRIBUTING.md を参照してください。
📄 ライセンス
このプロジェクトは MITライセンス の下でライセンスされています。詳細は LICENSE ファイルを参照してください。