Metadata-Version: 2.4
Name: check-hallucinations
Version: 0.2.0
Summary: Check BibTeX references for hallucinations before submitting a paper to arXiv
Author-email: Martin Monperrus <martin.monperrus@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/ASSERT-KTH/check-hallucinations
Project-URL: Bug Tracker, https://github.com/ASSERT-KTH/check-hallucinations/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Text Processing :: Markup :: LaTeX
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: bibtexparser
Requires-Dist: requests
Dynamic: license-file

# check-hallucinations

A command-line tool to detect hallucinated references in BibTeX files before submitting a paper to arXiv.

It checks each reference against [Semantic Scholar](https://www.semanticscholar.org/) and flags any title that cannot be found.

## Installation

```bash
pip install check-hallucinations
```

## Usage

```bash
check-hallucinations references.bib
```

Entries that cannot be found on Semantic Scholar are printed in red as potential hallucinations.

## How it works

For each entry in the BibTeX file, the tool queries Semantic Scholar by title. If no match is found, the entry is flagged as a likely hallucination (a reference invented by an LLM or a typo). `misc` entries without an `eprint` field are skipped unless they lack a `howpublished` URL.

## API key

By default the tool uses the public Semantic Scholar API (rate-limited). For higher throughput, set the `SEMANTICSCHOLAR_API_KEY` environment variable:

```bash
export SEMANTICSCHOLAR_API_KEY=your-key-here
check-hallucinations references.bib
```

## License

MIT
