Spaces:
Sleeping
Sleeping
Update backup_features.py
Browse files- backup_features.py +33 -20
backup_features.py
CHANGED
|
@@ -1,30 +1,43 @@
|
|
| 1 |
-
|
| 2 |
-
return {
|
| 3 |
-
"parties": ["Party A", "Party B"],
|
| 4 |
-
"dates": ["January 1, 2024"],
|
| 5 |
-
"amounts": ["$10,000"]
|
| 6 |
-
}
|
| 7 |
|
| 8 |
def extract_clauses(text):
|
| 9 |
-
return [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
def
|
| 12 |
return [
|
| 13 |
-
"
|
| 14 |
-
"
|
| 15 |
-
"Unilateral termination clause
|
| 16 |
-
"
|
| 17 |
-
"
|
| 18 |
]
|
| 19 |
|
| 20 |
def fairness_score(text):
|
| 21 |
-
user
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
-
def alternative_clauses():
|
| 26 |
return [
|
| 27 |
-
"
|
| 28 |
-
"
|
| 29 |
-
"
|
| 30 |
]
|
|
|
|
| 1 |
+
import re
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
def extract_clauses(text):
|
| 4 |
+
return [
|
| 5 |
+
{
|
| 6 |
+
"title": "Confidentiality",
|
| 7 |
+
"eli5": "Keep shared secrets safe.",
|
| 8 |
+
"simple": "You must protect confidential information.",
|
| 9 |
+
"pro": "Recipient shall maintain strict confidentiality over protected disclosures."
|
| 10 |
+
},
|
| 11 |
+
{
|
| 12 |
+
"title": "Non-Disclosure",
|
| 13 |
+
"eli5": "Don't tell anyone.",
|
| 14 |
+
"simple": "You agree not to disclose protected information.",
|
| 15 |
+
"pro": "Recipient shall not disseminate any protected information to unauthorized parties."
|
| 16 |
+
}
|
| 17 |
+
]
|
| 18 |
|
| 19 |
+
def get_risks(text):
|
| 20 |
return [
|
| 21 |
+
"Broad confidentiality scope",
|
| 22 |
+
"Indefinite protection period",
|
| 23 |
+
"Unilateral termination clause",
|
| 24 |
+
"Unclear data-handling terms",
|
| 25 |
+
"No liability limitation"
|
| 26 |
]
|
| 27 |
|
| 28 |
def fairness_score(text):
|
| 29 |
+
return {"user": 40, "company": 60}
|
| 30 |
+
|
| 31 |
+
def extract_entities(text):
|
| 32 |
+
return {
|
| 33 |
+
"parties": re.findall(r"[A-Z][a-z]+ [A-Z][a-z]+", text),
|
| 34 |
+
"dates": re.findall(r"\b\d{4}\b", text),
|
| 35 |
+
"money": re.findall(r"\$\d+", text)
|
| 36 |
+
}
|
| 37 |
|
| 38 |
+
def alternative_clauses(text):
|
| 39 |
return [
|
| 40 |
+
"Confidentiality limited to 3 years.",
|
| 41 |
+
"Mutual NDA instead of one-way.",
|
| 42 |
+
"Liability capped at actual damages."
|
| 43 |
]
|