This project uses mise to manage tool versions (Python, Just, etc.).
-
Install mise:
curl https://mise.run | sh -
Trust the project configuration:
mise trust
# Install all tools and create virtual environment automatically
mise install
# Activate virtual environment
source .venv/bin/activateRun just --list to see all available commands:
| Command | Description |
|---|---|
just install |
Install project dependencies |
just install_venv |
Create/update virtual environment |
just test |
Run tests |
just start |
Start services with Docker |
just formatter |
Format code with black |
just check_format |
Check code formatting |
- Python is pinned to version
3.14.4in.mise.toml - Just is pinned to version
1.50.0for consistent task running - The virtual environment path (
.venv/bin) is automatically added to PATH when the venv exists - On first
mise install, the venv is automatically created and dependencies are installed
The service exposes a REST API to manage cross-document reference predictions. Below is a typical workflow:
curl -X POST http://localhost:8000/destinations \
-H "Content-Type: application/json" \
-d '{
"namespace": "my_project",
"language": "en",
"destinations": [
{"name": "Paris", "type": "Location", "external_id": "loc_01", "alternative_names": ["París"]},
{"name": "Acme Corp", "type": "Organization", "external_id": "org_01", "alternative_names": []}
]
}'curl -X POST http://localhost:8000/reference_occurrences \
-H "Content-Type: application/json" \
-d '{
"namespace": "my_project",
"language": "en",
"occurrences": [
{"text": "the Company", "destination": "Acme Corp", "pdf_name": "doc1.pdf", "page": 3, "segment_text": "the Company signed the agreement"}
]
}'curl -X POST http://localhost:8000/negative_samples \
-H "Content-Type: application/json" \
-d '{
"namespace": "my_project",
"language": "en",
"destination": "Paris",
"segments": [
{"text": "Paris is a beautiful city", "pdf_name": "doc1.pdf", "page": 1}
]
}'curl -X PUT http://localhost:8000/destinations/Paris \
-H "Content-Type: application/json" \
-d '{"name": "Paris", "type": "Location", "external_id": "loc_01", "alternative_names": ["París", "City of Light"]}'Process a document (PDF or raw text) and get predicted cross-references:
# With a PDF file
curl -X POST http://localhost:8000/ \
-F "namespace=my_project" \
-F "language=en" \
-F "file=@document.pdf"
# With raw text
curl -X POST http://localhost:8000/ \
-F "namespace=my_project" \
-F "language=en" \
-F "identifier=doc_01" \
-F "text=The Company headquartered in Paris announced..."curl -X POST http://localhost:8000/delete_namespace \
-F "namespace=my_project" \
-F "language=en"mise use python@3.13This updates the Python version and triggers the post-install hook to recreate the venv.