Hasan Iqbal
commited on
Edited README.md to include description of the project
Browse files- README.md +89 -1
- assets/architecture.png +0 -0
README.md
CHANGED
|
@@ -10,7 +10,9 @@ pinned: false
|
|
| 10 |
|
| 11 |
<p align="center">
|
| 12 |
<img alt="OpenFactCheck Logo" src="https://raw.githubusercontent.com/hasaniqbal777/OpenFactCheck/main/assets/splash.png" height="120" />
|
| 13 |
-
<p align="center">An Open-source Factuality Evaluation Demo for LLMs
|
|
|
|
|
|
|
| 14 |
</p>
|
| 15 |
|
| 16 |
---
|
|
@@ -32,8 +34,94 @@ pinned: false
|
|
| 32 |
<a href="https://pypi.org/project/openfactcheck/">
|
| 33 |
<img src="https://img.shields.io/pypi/v/openfactcheck.svg" alt="PyPI Latest Release">
|
| 34 |
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
</p>
|
| 36 |
|
| 37 |
## Overview
|
| 38 |
|
| 39 |
OpenFactCheck is an open-source repository designed to facilitate the evaluation and enhancement of factuality in responses generated by large language models (LLMs). This project aims to integrate various fact-checking tools into a unified framework and provide comprehensive evaluation pipelines.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
<p align="center">
|
| 12 |
<img alt="OpenFactCheck Logo" src="https://raw.githubusercontent.com/hasaniqbal777/OpenFactCheck/main/assets/splash.png" height="120" />
|
| 13 |
+
<p align="center">An Open-source Factuality Evaluation Demo for LLMs
|
| 14 |
+
<br>
|
| 15 |
+
</p>
|
| 16 |
</p>
|
| 17 |
|
| 18 |
---
|
|
|
|
| 34 |
<a href="https://pypi.org/project/openfactcheck/">
|
| 35 |
<img src="https://img.shields.io/pypi/v/openfactcheck.svg" alt="PyPI Latest Release">
|
| 36 |
</a>
|
| 37 |
+
<a href="https://arxiv.org/abs/2405.05583"><img src="https://img.shields.io/badge/arXiv-2405.05583-B31B1B" alt="arXiv"></a>
|
| 38 |
+
<a href="https://zenodo.org/doi/10.5281/zenodo.13358664"><img src="https://zenodo.org/badge/829374815.svg" alt="DOI"></a>
|
| 39 |
+
</p>
|
| 40 |
+
|
| 41 |
+
---
|
| 42 |
+
|
| 43 |
+
<p align="center">
|
| 44 |
+
<a href="#overview">Overview</a> •
|
| 45 |
+
<a href="#installation">Installation</a> •
|
| 46 |
+
<a href="#usage">Usage</a> •
|
| 47 |
+
<a href="https://huggingface.co/spaces/hasaniqbal777/OpenFactCheck">HuggingFace Demo</a> •
|
| 48 |
+
<a href="https://openfactcheck.readthedocs.io/">Documentation</a>
|
| 49 |
</p>
|
| 50 |
|
| 51 |
## Overview
|
| 52 |
|
| 53 |
OpenFactCheck is an open-source repository designed to facilitate the evaluation and enhancement of factuality in responses generated by large language models (LLMs). This project aims to integrate various fact-checking tools into a unified framework and provide comprehensive evaluation pipelines.
|
| 54 |
+
|
| 55 |
+
<img src="https://raw.githubusercontent.com/hasaniqbal777/OpenFactCheck/main/assets/architecture.png" width="100%">
|
| 56 |
+
|
| 57 |
+
## Installation
|
| 58 |
+
|
| 59 |
+
You can install the package from PyPI using pip:
|
| 60 |
+
|
| 61 |
+
```bash
|
| 62 |
+
pip install openfactcheck
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
## Usage
|
| 66 |
+
|
| 67 |
+
First, you need to initialize the OpenFactCheckConfig object and then the OpenFactCheck object.
|
| 68 |
+
```python
|
| 69 |
+
from openfactcheck import OpenFactCheck, OpenFactCheckConfig
|
| 70 |
+
|
| 71 |
+
# Initialize the OpenFactCheck object
|
| 72 |
+
config = OpenFactCheckConfig()
|
| 73 |
+
ofc = OpenFactCheck(config)
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
### Response Evaluation
|
| 77 |
+
|
| 78 |
+
You can evaluate a response using the `ResponseEvaluator` class.
|
| 79 |
+
|
| 80 |
+
```python
|
| 81 |
+
# Evaluate a response
|
| 82 |
+
result = ofc.ResponseEvaluator.evaluate(response: str)
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
### LLM Evaluation
|
| 86 |
+
|
| 87 |
+
We provide [FactQA](https://raw.githubusercontent.com/hasaniqbal777/OpenFactCheck/main/src/openfactcheck/templates/llm/questions.csv), a dataset of 6480 questions for evaluating LLMs. Onc you have the responses from the LLM, you can evaluate them using the `LLMEvaluator` class.
|
| 88 |
+
|
| 89 |
+
```python
|
| 90 |
+
# Evaluate an LLM
|
| 91 |
+
result = ofc.LLMEvaluator.evaluate(model_name: str,
|
| 92 |
+
input_path: str)
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
### Checker Evaluation
|
| 96 |
+
|
| 97 |
+
We provide [FactBench](https://raw.githubusercontent.com/hasaniqbal777/OpenFactCheck/main/src/openfactcheck/templates/factchecker/claims.jsonl), a dataset of 4507 claims for evaluating fact-checkers. Once you have the responses from the fact-checker, you can evaluate them using the `CheckerEvaluator` class.
|
| 98 |
+
|
| 99 |
+
```python
|
| 100 |
+
# Evaluate a fact-checker
|
| 101 |
+
result = ofc.CheckerEvaluator.evaluate(checker_name: str,
|
| 102 |
+
input_path: str)
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
## Cite
|
| 106 |
+
|
| 107 |
+
If you use OpenFactCheck in your research, please cite the following:
|
| 108 |
+
|
| 109 |
+
```bibtex
|
| 110 |
+
@article{wang2024openfactcheck,
|
| 111 |
+
title = {OpenFactCheck: A Unified Framework for Factuality Evaluation of LLMs},
|
| 112 |
+
author = {Wang, Yuxia and Wang, Minghan and Iqbal, Hasan and Georgiev, Georgi and Geng, Jiahui and Nakov, Preslav},
|
| 113 |
+
journal = {arXiv preprint arXiv:2405.05583},
|
| 114 |
+
year = {2024}
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
@software{hasan_iqbal_2024_13358665,
|
| 118 |
+
author = {Hasan Iqbal},
|
| 119 |
+
title = {hasaniqbal777/OpenFactCheck: v0.3.0},
|
| 120 |
+
month = {aug},
|
| 121 |
+
year = {2024},
|
| 122 |
+
publisher = {Zenodo},
|
| 123 |
+
version = {v0.3.0},
|
| 124 |
+
doi = {10.5281/zenodo.13358665},
|
| 125 |
+
url = {https://doi.org/10.5281/zenodo.13358665}
|
| 126 |
+
}
|
| 127 |
+
```
|
assets/architecture.png
ADDED
|