Hasan Iqbal
commited on
Commit
•
a7431bb
1
Parent(s):
30500c8
Added doc homepage
Browse files- docs/src/_static/_css/custom.css +53 -0
- docs/src/_static/index_api.svg +97 -0
- docs/src/_static/index_contribute.svg +76 -0
- docs/src/_static/index_getting_started.svg +66 -0
- docs/src/_static/index_user_guide.svg +67 -0
- docs/src/conf.py +71 -1
- docs/src/development/index.md +1 -0
- docs/src/getting_started/index.md +1 -0
- docs/src/index.md +106 -13
- docs/src/usage/index.md +0 -1
- docs/src/user_guide/index.md +2 -0
docs/src/_static/_css/custom.css
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Override some aspects of the pydata-sphinx-theme */
|
2 |
+
|
3 |
+
:root {
|
4 |
+
/* Use softer blue from bootstrap's default info color */
|
5 |
+
--pst-color-info: 23, 162, 184;
|
6 |
+
}
|
7 |
+
|
8 |
+
table {
|
9 |
+
width: auto; /* Override fit-content which breaks Styler user guide ipynb */
|
10 |
+
}
|
11 |
+
|
12 |
+
/* Main index page overview cards */
|
13 |
+
|
14 |
+
.intro-card {
|
15 |
+
padding: 10px 10px 10px 10px;
|
16 |
+
}
|
17 |
+
|
18 |
+
.intro-card .sd-card-img-top {
|
19 |
+
margin: 10px;
|
20 |
+
height: 52px;
|
21 |
+
background: none !important;
|
22 |
+
position: relative;
|
23 |
+
}
|
24 |
+
|
25 |
+
.intro-card .sd-card-title {
|
26 |
+
color: var(--pst-color-primary);
|
27 |
+
font-size: var(--pst-font-size-h5);
|
28 |
+
padding: 0rem 0rem 0rem 0rem;
|
29 |
+
}
|
30 |
+
|
31 |
+
.intro-card .sd-card-footer {
|
32 |
+
border: none !important;
|
33 |
+
}
|
34 |
+
|
35 |
+
.intro-card .sd-card-footer p.sd-card-text {
|
36 |
+
max-width: 220px;
|
37 |
+
margin-left: auto;
|
38 |
+
margin-right: auto;
|
39 |
+
}
|
40 |
+
|
41 |
+
.intro-card .sd-btn-secondary {
|
42 |
+
background-color: #6c757d !important;
|
43 |
+
border-color: #6c757d !important;
|
44 |
+
}
|
45 |
+
|
46 |
+
.intro-card .sd-btn-secondary:hover {
|
47 |
+
background-color: #5a6268 !important;
|
48 |
+
border-color: #545b62 !important;
|
49 |
+
}
|
50 |
+
|
51 |
+
.card, .card img {
|
52 |
+
background-color: var(--pst-color-background);
|
53 |
+
}
|
docs/src/_static/index_api.svg
ADDED
docs/src/_static/index_contribute.svg
ADDED
docs/src/_static/index_getting_started.svg
ADDED
docs/src/_static/index_user_guide.svg
ADDED
docs/src/conf.py
CHANGED
@@ -8,6 +8,9 @@ https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
8 |
# -- Path setup --------------------------------------------------------------
|
9 |
import os
|
10 |
import sys
|
|
|
|
|
|
|
11 |
from pathlib import Path
|
12 |
from typing import Any, Dict
|
13 |
|
@@ -33,6 +36,12 @@ extensions = [
|
|
33 |
"sphinx.ext.viewcode",
|
34 |
"sphinx.ext.intersphinx",
|
35 |
"sphinx.ext.graphviz",
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
"sphinxext.rediraffe",
|
37 |
"sphinx_design",
|
38 |
"sphinx_copybutton",
|
@@ -207,7 +216,9 @@ html_context = {
|
|
207 |
# relative to this directory. They are copied after the builtin static files,
|
208 |
# so a file named "default.css" will overwrite the builtin "default.css".
|
209 |
html_static_path = ["_static"]
|
210 |
-
html_css_files = [
|
|
|
|
|
211 |
html_js_files = ["custom-icons.js"]
|
212 |
todo_include_todos = True
|
213 |
|
@@ -245,6 +256,65 @@ favicons = [
|
|
245 |
|
246 |
# -- application setup -------------------------------------------------------
|
247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
|
249 |
def setup_to_main(
|
250 |
app: Sphinx, pagename: str, templatename: str, context, doctree
|
|
|
8 |
# -- Path setup --------------------------------------------------------------
|
9 |
import os
|
10 |
import sys
|
11 |
+
import inspect
|
12 |
+
import warnings
|
13 |
+
|
14 |
from pathlib import Path
|
15 |
from typing import Any, Dict
|
16 |
|
|
|
36 |
"sphinx.ext.viewcode",
|
37 |
"sphinx.ext.intersphinx",
|
38 |
"sphinx.ext.graphviz",
|
39 |
+
"sphinx.ext.linkcode",
|
40 |
+
"sphinx.ext.coverage",
|
41 |
+
"sphinx.ext.doctest",
|
42 |
+
"sphinx.ext.extlinks",
|
43 |
+
"sphinx.ext.ifconfig",
|
44 |
+
"sphinx.ext.mathjax",
|
45 |
"sphinxext.rediraffe",
|
46 |
"sphinx_design",
|
47 |
"sphinx_copybutton",
|
|
|
216 |
# relative to this directory. They are copied after the builtin static files,
|
217 |
# so a file named "default.css" will overwrite the builtin "default.css".
|
218 |
html_static_path = ["_static"]
|
219 |
+
html_css_files = [
|
220 |
+
"_css/custom.css",
|
221 |
+
]
|
222 |
html_js_files = ["custom-icons.js"]
|
223 |
todo_include_todos = True
|
224 |
|
|
|
256 |
|
257 |
# -- application setup -------------------------------------------------------
|
258 |
|
259 |
+
# based on numpy doc/source/conf.py
|
260 |
+
def linkcode_resolve(domain, info) -> str | None:
|
261 |
+
"""
|
262 |
+
Determine the URL corresponding to Python object
|
263 |
+
"""
|
264 |
+
if domain != "py":
|
265 |
+
return None
|
266 |
+
|
267 |
+
modname = info["module"]
|
268 |
+
fullname = info["fullname"]
|
269 |
+
|
270 |
+
submod = sys.modules.get(modname)
|
271 |
+
if submod is None:
|
272 |
+
return None
|
273 |
+
|
274 |
+
obj = submod
|
275 |
+
for part in fullname.split("."):
|
276 |
+
try:
|
277 |
+
with warnings.catch_warnings():
|
278 |
+
# Accessing deprecated objects will generate noisy warnings
|
279 |
+
warnings.simplefilter("ignore", FutureWarning)
|
280 |
+
obj = getattr(obj, part)
|
281 |
+
except AttributeError:
|
282 |
+
return None
|
283 |
+
|
284 |
+
try:
|
285 |
+
fn = inspect.getsourcefile(inspect.unwrap(obj))
|
286 |
+
except TypeError:
|
287 |
+
try: # property
|
288 |
+
fn = inspect.getsourcefile(inspect.unwrap(obj.fget))
|
289 |
+
except (AttributeError, TypeError):
|
290 |
+
fn = None
|
291 |
+
if not fn:
|
292 |
+
return None
|
293 |
+
|
294 |
+
try:
|
295 |
+
source, lineno = inspect.getsourcelines(obj)
|
296 |
+
except TypeError:
|
297 |
+
try: # property
|
298 |
+
source, lineno = inspect.getsourcelines(obj.fget)
|
299 |
+
except (AttributeError, TypeError):
|
300 |
+
lineno = None
|
301 |
+
except OSError:
|
302 |
+
lineno = None
|
303 |
+
|
304 |
+
if lineno:
|
305 |
+
linespec = f"#L{lineno}-L{lineno + len(source) - 1}"
|
306 |
+
else:
|
307 |
+
linespec = ""
|
308 |
+
|
309 |
+
fn = os.path.relpath(fn, start=os.path.dirname(openfactcheck.__file__))
|
310 |
+
|
311 |
+
if "+" in openfactcheck.__version__:
|
312 |
+
return f"https://github.com/hasaniqbal777/openfactcheck/blob/main/openfactcheck/{fn}{linespec}"
|
313 |
+
else:
|
314 |
+
return (
|
315 |
+
f"https://github.com/hasaniqbal777/openfactcheck/blob/"
|
316 |
+
f"v{openfactcheck.__version__}/openfactcheck/{fn}{linespec}"
|
317 |
+
)
|
318 |
|
319 |
def setup_to_main(
|
320 |
app: Sphinx, pagename: str, templatename: str, context, doctree
|
docs/src/development/index.md
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
# Development
|
docs/src/getting_started/index.md
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
# Getting Started
|
docs/src/index.md
CHANGED
@@ -9,28 +9,121 @@ html_theme.sidebar_secondary.remove: true
|
|
9 |
|
10 |
# OpenFactCheck Documentation
|
11 |
|
12 |
-
|
|
|
|
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
|
18 |
-
|
|
|
19 |
|
20 |
-
|
21 |
|
22 |
-
```{
|
23 |
-
:
|
24 |
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
26 |
```
|
27 |
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
```{toctree}
|
33 |
-
:
|
|
|
|
|
34 |
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
9 |
|
10 |
# OpenFactCheck Documentation
|
11 |
|
12 |
+
```{eval-rst}
|
13 |
+
.. module:: openfactcheck
|
14 |
+
```
|
15 |
|
16 |
+
OpenFactCheck is an open source, Apache-licensed library designed to facilitate the evaluation and enhancement of factuality in responses generated by large language models (LLMs).
|
17 |
|
18 |
+
The design of {mod}`openfactcheck` emphasizes two principles:
|
19 |
|
20 |
+
- Customizability and extensibility for both users and developers
|
21 |
+
- Compatibility with existing methods and datasets
|
22 |
|
23 |
+
It consists of three core modules:
|
24 |
|
25 |
+
```{gallery-grid}
|
26 |
+
:grid-columns: 1 1 2 3
|
27 |
|
28 |
+
- header: "{fas}`check-to-slot;pst-color-primary` Response Evaluator"
|
29 |
+
content: "Customizes an automatic fact-checker to verify free-form documents, providing detailed reports on the factuality of the responses."
|
30 |
+
- header: "{fas}`chart-line;pst-color-primary` LLM Evaluator"
|
31 |
+
content: "Applies factuality-specific benchmarks to assess the factual performance of large language models, providing detailed reports on the factuality of the responses."
|
32 |
+
- header: "{fas}`trophy;pst-color-primary` Fact Checker Evaluator"
|
33 |
+
content: "Evaluates fact-checking accuracy, featuring a leaderboard that ranks systems by precision, speed, and cost, driving innovation in automatic fact-checking."
|
34 |
```
|
35 |
|
36 |
+
Explore the documentation to learn more about the library, its features, how to use and contribute to it, and more.
|
37 |
+
|
38 |
+
```{eval-rst}
|
39 |
+
.. grid:: 1 2 2 2
|
40 |
+
:gutter: 4
|
41 |
+
:padding: 2 2 0 0
|
42 |
+
:class-container: sd-text-center
|
43 |
+
|
44 |
+
.. grid-item-card:: Getting Started
|
45 |
+
:img-top: _static/index_getting_started.svg
|
46 |
+
:class-card: intro-card
|
47 |
+
:shadow: md
|
48 |
+
|
49 |
+
New to *OpenFactCheck*? Check out the getting started guides. They contain an
|
50 |
+
introduction to *OpenFactCheck*'s main concepts and links to additional tutorials.
|
51 |
+
|
52 |
+
+++
|
53 |
+
|
54 |
+
.. button-ref:: getting_started/index
|
55 |
+
:ref-type: doc
|
56 |
+
:color: secondary
|
57 |
+
:expand:
|
58 |
+
|
59 |
+
Begin Your Journey
|
60 |
+
|
61 |
+
.. grid-item-card:: User Guide
|
62 |
+
:img-top: _static/index_user_guide.svg
|
63 |
+
:class-card: intro-card
|
64 |
+
:shadow: md
|
65 |
+
|
66 |
+
The user guide provides in-depth information on the
|
67 |
+
key concepts of *OpenFactCheck* with useful background information and explanation.
|
68 |
+
|
69 |
+
+++
|
70 |
+
|
71 |
+
.. button-ref:: user_guide/index
|
72 |
+
:ref-type: doc
|
73 |
+
:color: secondary
|
74 |
+
:expand:
|
75 |
|
76 |
+
View User Guide
|
77 |
+
|
78 |
+
.. grid-item-card:: API Reference
|
79 |
+
:img-top: _static/index_api.svg
|
80 |
+
:class-card: intro-card
|
81 |
+
:shadow: md
|
82 |
+
|
83 |
+
The reference guide contains a detailed description of
|
84 |
+
the *OpenFactCheck* API. The reference describes how the methods work and which parameters can
|
85 |
+
be used. It assumes that you have an understanding of the key concepts.
|
86 |
+
|
87 |
+
+++
|
88 |
+
|
89 |
+
.. button-ref:: api/index
|
90 |
+
:ref-type: doc
|
91 |
+
:color: secondary
|
92 |
+
:expand:
|
93 |
+
|
94 |
+
View API Reference
|
95 |
+
|
96 |
+
.. grid-item-card:: Developer Guide
|
97 |
+
:img-top: _static/index_contribute.svg
|
98 |
+
:class-card: intro-card
|
99 |
+
:shadow: md
|
100 |
+
|
101 |
+
Want to improve existing functionalities? Saw a typo in the documentation?
|
102 |
+
Want to contribute to the project? The contributing guidelines will guide
|
103 |
+
you through the process of improving *OpenFactCheck*.
|
104 |
+
|
105 |
+
+++
|
106 |
+
|
107 |
+
.. button-ref:: development/index
|
108 |
+
:ref-type: doc
|
109 |
+
:color: secondary
|
110 |
+
:expand:
|
111 |
+
|
112 |
+
Contribute
|
113 |
+
```
|
114 |
+
|
115 |
+
**Useful links**:
|
116 |
+
[Binary Installers](https://pypi.org/project/openfactcheck) |
|
117 |
+
[Source Repository](https://github.com/hasaniqbal777/openfactcheck) |
|
118 |
+
[Issues & Ideas](https://github.com/hasaniqbal777/openfactcheck/issues) |
|
119 |
|
120 |
```{toctree}
|
121 |
+
:hidden: true
|
122 |
+
:maxdepth: 3
|
123 |
+
:titlesonly: true
|
124 |
|
125 |
+
getting_started/index
|
126 |
+
user_guide/index
|
127 |
+
api/index
|
128 |
+
development/index
|
129 |
+
```
|
docs/src/usage/index.md
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
# Usage
|
|
|
|
docs/src/user_guide/index.md
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
# User Guide
|
2 |
+
|