hv-fold / example.py
zeechimp's picture
Create example.py
7dcc17b verified
Raw History Blame Contribute Delete
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()