Spaces:
Sleeping
Sleeping
| import re | |
| def extract_clauses(text): | |
| return [ | |
| { | |
| "title": "Confidentiality", | |
| "eli5": "Keep shared secrets safe.", | |
| "simple": "You must protect confidential information.", | |
| "pro": "Recipient shall maintain strict confidentiality over protected disclosures." | |
| }, | |
| { | |
| "title": "Non-Disclosure", | |
| "eli5": "Don't tell anyone.", | |
| "simple": "You agree not to disclose protected information.", | |
| "pro": "Recipient shall not disseminate any protected information to unauthorized parties." | |
| } | |
| ] | |
| def get_risks(text): | |
| return [ | |
| "Broad confidentiality scope", | |
| "Indefinite protection period", | |
| "Unilateral termination clause", | |
| "Unclear data-handling terms", | |
| "No liability limitation" | |
| ] | |
| def fairness_score(text): | |
| return {"user": 40, "company": 60} | |
| def extract_entities(text): | |
| return { | |
| "parties": re.findall(r"[A-Z][a-z]+ [A-Z][a-z]+", text), | |
| "dates": re.findall(r"\b\d{4}\b", text), | |
| "money": re.findall(r"\$\d+", text) | |
| } | |
| def alternative_clauses(text): | |
| return [ | |
| "Confidentiality limited to 3 years.", | |
| "Mutual NDA instead of one-way.", | |
| "Liability capped at actual damages." | |
| ] | |