Download example.py from zeechimp/hv-fold: direct link, hf CLI and curl.
- Browser
- Download file 886 Bytes
-
https://huggingface.co/zeechimp/hv-fold/resolve/main/example.py
- Command line
-
hf download hf://zeechimp/hv-fold/example.py
-
curl -L -o example.py https://huggingface.co/zeechimp/hv-fold/resolve/main/example.py
886 Bytes
| """Minimal usage example for hv-fold.""" | |
| from hv_fold import HVFold | |
| TEXT = ( | |
| "As noted above, the effect is small. The mechanism remains unclear. " | |
| "The data suggest a confound, as discussed below." | |
| ) | |
| def main() -> None: | |
| model = HVFold() | |
| report = model.analyze(TEXT) | |
| print("=" * 60) | |
| print("hv-fold") | |
| print("=" * 60) | |
| print(model.render(report)) | |
| print() | |
| print("=" * 60) | |
| print("Numeric summary") | |
| print("=" * 60) | |
| print(f" fold : {report.fold:.4f}") | |
| print(f" tier : {report.fold_tier}") | |
| print(f" total load : {report.total_load:.4f}") | |
| print(f" sentences : {report.n_sentences}") | |
| print(f" anchors : {report.anchor_sentences}") | |
| print(f" reentry pts : {report.reentry_points}") | |
| print(f" plan : {report.reading_plan}") | |
| print() | |
| if __name__ == "__main__": | |
| main() |