CiteScan / README.md
aivolcano
FastAPI + Gradio + src
3d83b62

A newer version of the Gradio SDK is available: 6.9.0

Upgrade
metadata
title: CiteScan
emoji: ๐Ÿ“š
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false

CiteScan: Check References, Confirm Truth.

CiteScan is an open-source and free tool designed to detect hallucinated references in academic writing. As AI coding assistants and writing tools become more prevalent, they sometimes generate plausible-sounding citations that do not actually exist. CiteScan addresses this issue by validating every bibliography entry against multiple authoritative academic databasesโ€”including arXiv, CrossRef, DBLP, Semantic Scholar, OpenAlex, and Google Scholarโ€”to confirm their authenticity.

Going beyond simple verification, CiteScan uses rule-based algorithms to analyze whether the cited papers genuinely support the claims made in your text. Thanks to the free accessibility for academic databases across CS and AI areas, our system will cost $0 for maintenance after development.

๐Ÿš€ Quick Start

Option 1: Web Interface (Gradio)

# Install dependencies
pip install -r requirements.txt

# Run Gradio interface
python app.py

Access at http://localhost:7860

Option 2: API Service (FastAPI)

# Install dependencies
pip install -r requirements.txt

# Run API service
python main.py

Access API at http://localhost:8000 API Documentation at http://localhost:8000/docs

Option 3: Docker

# Run both services with Docker Compose
docker-compose up -d

# Gradio: http://localhost:7860
# API: http://localhost:8000

๐Ÿ“š Documentation

๐Ÿ›ก Why CiteScan?

  • ๐Ÿšซ NO Hallucinations: Annotate citations that don't exist or have mismatched metadata across year, authors, and title.

  • ๐Ÿ“‹ Ground Truth Reference: Provide the link if the citations are flagged to issued entry. You can click the Open paper or DOI button to access the real-world metadata, and then cite the BibTeX from the press website.

Functions

  • ๐Ÿ  Top-tier Research Organizations: Cooperate with National University of Singapore (NUS) and Shanghai Jiao Tong University (SJTU).

  • ๐Ÿ”Œ RESTful API: Production-ready API for integration with other tools and services.

โœจ Features

Web Interface (Gradio)

  • User-friendly interface for manual verification
  • Real-time progress tracking
  • Interactive filtering by verification status
  • Visual presentation of results

API Service (FastAPI)

  • RESTful API for programmatic access
  • Automatic OpenAPI documentation
  • JSON responses for easy integration
  • Health checks and monitoring endpoints
  • Structured logging
  • Caching for improved performance

๐Ÿ” References Validation

  • Multi-Source Verification: Validates metadata against arXiv, CrossRef, DBLP, Semantic Scholar, OpenAlex, and Google Scholar.

  • Covert citation from pre-print version to official version: After clicking the blue button (Open paper or DOI), the official website will display. Click the cite button, you can copy the official BibTex.

Citation

Verification Workflow

  1. Parse BibTeX: Extract entries and metadata
  2. Priority-based Search: Query databases in priority order
  3. Metadata Comparison: Compare title, authors, year, venue
  4. Duplicate Detection: Identify duplicate entries
  5. Result Generation: Provide detailed verification report

๐Ÿ“– API Usage Examples

Python

import requests

url = "http://localhost:8000/api/v1/verify"
bibtex = """
@article{vaswani2017attention,
  title={Attention is all you need},
  author={Vaswani, Ashish and Shazeer, Noam},
  year={2017}
}
"""

response = requests.post(url, json={"bibtex_content": bibtex})
result = response.json()

print(f"Verified: {result['verified_count']}/{result['total_count']}")

cURL

curl -X POST "http://localhost:8000/api/v1/verify" \
  -H "Content-Type: application/json" \
  -d '{"bibtex_content": "@article{example,title={Test},year={2023}}"}'

See API_DOCS.md for complete API documentation.

โš™๏ธ Configuration

Create a .env file from the template:

cp .env.example .env

Key configuration options:

# Server ports
API_PORT=8000
GRADIO_PORT=7860

# Performance
MAX_WORKERS=10
CACHE_ENABLED=true
CACHE_TTL=3600

# Logging
LOG_LEVEL=INFO
LOG_FORMAT=json

See DEPLOYMENT.md for complete configuration guide.

๐Ÿ—๏ธ Architecture

CiteScan/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ api/              # FastAPI routes and schemas
โ”‚   โ”œโ”€โ”€ services/         # Business logic layer
โ”‚   โ”œโ”€โ”€ core/             # Configuration, logging, cache
โ”‚   โ”œโ”€โ”€ fetchers/         # Database API clients
โ”‚   โ”œโ”€โ”€ analyzers/        # Metadata comparison
โ”‚   โ”œโ”€โ”€ parsers/          # BibTeX parsing
โ”‚   โ””โ”€โ”€ utils/            # Utilities
โ”œโ”€โ”€ app.py                # Gradio interface
โ”œโ”€โ”€ main.py               # FastAPI application
โ”œโ”€โ”€ Dockerfile            # Container configuration
โ””โ”€โ”€ docker-compose.yml    # Multi-service setup

๐Ÿ”ง Development

Setup Development Environment

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Copy environment template
cp .env.example .env

# Run in development mode
ENVIRONMENT=development python main.py

Project Structure

  • Services Layer: Reusable business logic
  • API Layer: RESTful endpoints with FastAPI
  • UI Layer: Gradio interface
  • Core: Configuration, logging, caching
  • Fetchers: Database API integrations

๐Ÿ“Š Monitoring

Health Check

curl http://localhost:8000/api/v1/health

Statistics

curl http://localhost:8000/api/v1/stats

Logs

Logs are stored in logs/citescan.log in JSON format:

tail -f logs/citescan.log | jq '.'

โš ๏ธ Case Study for False Positives

  1. Authors Mismatch:

    • Reason: Different databases deal with a longer list of authors with different strategies, like truncation.
    • Action: Verify if main authors match
  2. Venues Mismatch:

    • Reason: Abbreviations vs. full names, such as "ICLR" vs. "International Conference on Learning Representations"
    • Action: Both are correct.
  3. Year GAP (ยฑ1 Year):

    • Reason: Delay between preprint (arXiv) and final version publication
    • Action: Verify which version you intend to cite. We recommend citing the version from the official press website. Lower pre-print version bib will make your submission more convincing.
  4. Non-academic Sources:

    • Reason: Blogs and APIs are not indexed in academic databases.
    • Action: Verify URL, year, and title manually.

๐Ÿ™ Acknowledgments

CiteScan uses multiple data sources:

  • arXiv API
  • CrossRef API
  • Semantic Scholar API
  • DBLP API
  • OpenAlex API
  • Google Scholar (web scraping)

๐Ÿ“ License

[Add your license here]

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“ง Contact

For questions and support:


๐Ÿš€ ModelScope Deployment

To deploy on ModelScope ๅˆ›็ฉบ้—ด:

# Add ModelScope remote
git remote add modelscope "http://oauth2:YOUR_TOKEN@www.modelscope.cn/studios/YOUR_USERNAME/CiteScan.git"

# Push to ModelScope
git push modelscope main

# Or force push if needed
git push modelscope main --force

After pushing, visit your ModelScope studio and click "ไธŠ็บฟ็ฉบ้—ดๅฑ•็คบ" or "็ซ‹ๅณๅ‘ๅธƒ" to deploy the Gradio application.


๐Ÿš€ Hugging Face Spaces ้ƒจ็ฝฒ

ๅฐ†ไปฃ็ ๆŽจ้€ๅˆฐ Hugging Face Spaces๏ผš

  1. ๅฎ‰่ฃ… Hugging Face CLI ๅนถ็™ปๅฝ•๏ผˆๅฆ‚ๆœชๅฎ‰่ฃ…๏ผ‰๏ผš

    pip install huggingface_hub
    huggingface-cli login
    
  2. ๆทปๅŠ  Hugging Face ่ฟœ็จ‹ไป“ๅบ“๏ผš

    git remote add hf https://huggingface.co/spaces/yancan/CiteScan
    
  3. ๆŽจ้€ๅˆฐ Spaces๏ผˆHF ไธๅ…่ฎธๆ™ฎ้€š git ๆŽจ้€ไบŒ่ฟ›ๅˆถๆ–‡ไปถ๏ผŒ้œ€็”จๆ— ๅ›พ็‰‡ๅˆ†ๆ”ฏ hf-main๏ผ‰๏ผš

    • ้‡่ฆ๏ผšHF ไธŠๆ˜พ็คบ็š„ๆ˜ฏ ๅทฒๆไบคๅˆฐ main ็š„ไปฃ็ ใ€‚่‹ฅๆœฌๅœฐๆœ‰ๆœชๆไบค็š„ไฟฎๆ”น๏ผˆๅฆ‚ main.pyใ€src/ ็ญ‰๏ผ‰๏ผŒ้œ€ๅ…ˆๆไบคๅˆฐ main๏ผŒๅ†ๆ›ดๆ–ฐๅนถๆŽจ้€ hf-mainใ€‚
    • ไธ€้”ฎ่„šๆœฌ๏ผš./scripts/push_to_hf.sh๏ผˆไผšๆ็คบๅ…ˆๆไบคๆœชๆไบค็š„ไฟฎๆ”น๏ผŒๅ†้‡ๅปบ hf-main ๅนถๆŽจ้€๏ผ‰ใ€‚
    • ๆˆ–ๆ‰‹ๅŠจ๏ผšๅ…ˆ git add -A && git commit -m "่ฏดๆ˜Ž"๏ผŒๅ†่ฟ่กŒ่„šๆœฌๆˆ–ๆŒ‰่„šๆœฌๅ†…ๆญฅ้ชค้‡ๅปบ hf-main ๅนถ git push hf hf-main:main --forceใ€‚
  4. ๆŽจ้€ๅฎŒๆˆๅŽ๏ผŒๅœจ Space ้กต้ข ็ญ‰ๅพ…ๆž„ๅปบ็ป“ๆŸๅณๅฏ่ฎฟ้—ฎ Gradio ๅบ”็”จใ€‚

ๆณจๆ„๏ผšREADME ้กถ้ƒจ็š„ YAML ้…็ฝฎ๏ผˆtitleใ€sdkใ€app_file ็ญ‰๏ผ‰ไธบ Spaces ๅฟ…้œ€๏ผŒ่ฏทๅ‹ฟๅˆ ้™คใ€‚