A Python SDK for verifying, ranking, and reviewing multi-modal damage claims using Gemini vision models.
Project description
Multimodal Evidence SDK
multimodal-evidence-sdk is a Python SDK for verifying, ranking, and reviewing multi-modal damage claims using Gemini vision models. It provides structural validation and decision-making logic originally developed for the HackerRank Orchestrate Evidence Review platform.
Installation
Install the package locally in editable mode:
pip install -e .
SDK Usage
from multimodal_evidence import (
retrieve_evidence,
rank_evidence,
verify_claim
)
# 1. Verify a claim statement factually (Text-only)
result = verify_claim(
claim_text="India launched Chandrayaan-3 in 2023"
)
print(result["claim_status"]) # -> "supported"
# 2. Verify a damage claim with image evidence (Multimodal)
claim_result = verify_claim(
claim_text="The car rear bumper has a major dent",
images=["path/to/img_1.jpg"],
claim_object="car",
history={
"user_id": "usr_123",
"past_claim_count": 0,
"accept_claim": 0,
"manual_review_claim": 0,
"rejected_claim": 0,
"last_90_days_claim_count": 0,
"history_flags": "none",
"history_summary": ""
}
)
print(claim_result["claim_status"])
Command Line Interface (CLI)
The SDK registers the evidence executable.
1. Verify a Statement
evidence verify "The Earth has two moons"
For damage claims with images:
evidence verify "Rear bumper dent" --images "dataset/images/sample/case_001/img_1.jpg" --object car
2. Search Factual Details or Requirements
evidence search "Chandrayaan-3 launch"
evidence search car
3. Rank Evidence from JSON Payload
evidence rank evidence.json
Development & Evaluation
If you are participating in the HackerRank Orchestrate hackathon, you can run the evaluation metrics and pipeline using the scripts in code/:
1. Install Dependencies
cd code/
pip install -r requirements.txt
2. Set API Key
Copy the template .env.example to .env and insert your API key:
# code/.env
GOOGLE_API_KEY=your_gemini_api_key_here
3. Run Pipeline on Test Data
cd code/
python main.py
4. Run Strategy Evaluation
cd code/
python evaluation/main.py --compare
Project Structure
multimodal_evidence/: The SDK package directory.models/: Pydantic schemas and enums.retrieval/: Search and requirements indexing.ranking/: Guardrails and risk flag merging.verification/: Claims and factual verifications.multimodal/: Gemini client wrapper and batch pipeline runner.
code/: The hackathon pipeline interface (fully refactored to consume the SDK).dataset/: Claims databases and visual evidence.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multimodal_evidence_sdk-0.1.0.tar.gz.
File metadata
- Download URL: multimodal_evidence_sdk-0.1.0.tar.gz
- Upload date:
- Size: 55.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27e5654ce16bce76dd22ade002f717bbd20f321fdd5c2bd59c4ba7fbde715991
|
|
| MD5 |
719bb161c1b28a7ad040f1bee51b706a
|
|
| BLAKE2b-256 |
d66385bebd5dd0a096f8df6e2bf8bd80006b0fb14aeaec883e5e9bbad4fe14d7
|
File details
Details for the file multimodal_evidence_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: multimodal_evidence_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3192e2e73bbd26c0b4231817e7f404ded4f1e41ca39f3f637904987936c8c6c
|
|
| MD5 |
0f25a60986b709edf58e57558b668597
|
|
| BLAKE2b-256 |
e27e7e5371853bbf428e1d648b4690a3c42445d9008f1b4e16d490075134d082
|