Skip to content

s-nlp/dont-fight-hallucinations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Don't Fight Hallucinations, Use Them: Estimating Image Realism using NLI over Atomic Facts

This repository contains resources for the paper "Don't Fight Hallucinations, Use Them: Estimating Image Realism using NLI over Atomic Facts."

Files Overview

Data & Notebooks

  1. atomic_facts.jsonl
    A collection of generated atomic facts about images from the WHOOPS! dataset sampled using Diverse Beam Search from the LLaVA-v1.6-Mistral-7B model.

  2. notebooks/nli_agg.ipynb
    A Jupyter Notebook implementing Natural Language Inference (NLI) scoring with clustering aggregation scheme. It reproduces the main results for classification on the WHOOPS! dataset.

Scripts

Scripts should be run using Python’s module system: python -m scripts.script_name

  1. scripts/generate_facts.py
    Generates atomic facts for images following the fact generation protocol described in the paper.

  2. scripts/predict.py
    Uses the generated atomic facts to predict image realism.

Model Utilities

  1. model/utils.py
    Implements the computation of the Reality Score by calculating NLI-scores between atomic facts and aggregating them into a single score.

Method Illustration

Our method identifies contradictions between generated atomic facts to estimate image realism.

Example 1: Normal Image

A snow plow driving down a snowy street

Example 2: Weird Image

A large yellow truck driving through the sand

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •