suicideproject / src /predict_cli.py
Antigravity Deploy Agent
Deploy Suicide Risk Detection web application to Hugging Face Spaces
0be18fb
Raw
History Blame Contribute Delete
509 Bytes
import json
from .predict import SuicideRiskPredictor
def main():
p = SuicideRiskPredictor()
text = input("Enter text: ").strip()
print("\nPaste profile JSON (example: {\"age\":22,\"gender\":\"Male\",\"reason\":\"harassment\"})")
profile_json = input("Profile JSON: ").strip()
profile = json.loads(profile_json) if profile_json else {}
out = p.predict_one(text=text, profile=profile)
print("\nPrediction:\n", json.dumps(out, indent=2))
if __name__ == "__main__":
main()