deepthi6 commited on
Commit
dbf191a
·
verified ·
1 Parent(s): 2b23581

Update backup_features.py

Browse files
Files changed (1) hide show
  1. backup_features.py +33 -20
backup_features.py CHANGED
@@ -1,30 +1,43 @@
1
- def extract_entities(text):
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 ["Confidentiality", "Term", "IP Ownership"]
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
- def risk_analysis(text):
12
  return [
13
- "Very broad confidentiality scope.",
14
- "No defined liability cap.",
15
- "Unilateral termination clause.",
16
- "Unlimited data retention.",
17
- "Missing dispute resolution mechanism."
18
  ]
19
 
20
  def fairness_score(text):
21
- user = 35
22
- company = 65
23
- return (50, user, company)
 
 
 
 
 
24
 
25
- def alternative_clauses():
26
  return [
27
- "A mutual confidentiality version is commonly used.",
28
- "Liability caps between both parties are standard.",
29
- "Shorter NDA duration (1–2 years) is common."
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
  ]