karthikmn commited on
Commit
e12518f
·
verified ·
1 Parent(s): c4d9410

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +24 -14
model.py CHANGED
@@ -1,23 +1,33 @@
1
  import random
2
- from utilities import prepare_text_input, generate_recommendation
3
 
4
- # Mock objects (None used in mock version)
5
- def load_model():
6
- return None, None, None
 
 
 
 
 
 
 
 
7
 
8
  def predict(data, model, tokenizer, summarizer):
9
- text_input = prepare_text_input(data)
 
10
 
11
- # Simulated scoring logic
12
- score = random.randint(45, 95)
13
- confidence = round(random.uniform(0.6, 0.95), 2)
14
- risk = (
15
- "Low" if score > 75 else
16
- "Medium" if score >= 55 else
17
- "High"
18
- )
19
 
20
- recommendation = generate_recommendation(data)
 
 
 
 
21
 
22
  return {
23
  "score": score,
 
1
  import random
 
2
 
3
+ def generate_recommendation(stage, emails, meetings):
4
+ if stage == "Negotiation":
5
+ return "Follow up with final pricing discussion."
6
+ elif stage == "Proposal/Price Quote":
7
+ return "Schedule one more meeting to present value."
8
+ elif meetings == 0:
9
+ return "Schedule a meeting to initiate engagement."
10
+ elif emails < 2:
11
+ return "Send follow-up email to re-engage."
12
+ else:
13
+ return "Continue monitoring engagement signals."
14
 
15
  def predict(data, model, tokenizer, summarizer):
16
+ score = random.randint(50, 95)
17
+ confidence = round(random.uniform(0.65, 0.95), 2)
18
 
19
+ if score >= 75:
20
+ risk = "Low"
21
+ elif score >= 55:
22
+ risk = "Medium"
23
+ else:
24
+ risk = "High"
 
 
25
 
26
+ recommendation = generate_recommendation(
27
+ data["stage"],
28
+ data["emails_last_7_days"],
29
+ data["meetings_last_30_days"]
30
+ )
31
 
32
  return {
33
  "score": score,