-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextractor.py
More file actions
35 lines (23 loc) · 806 Bytes
/
extractor.py
File metadata and controls
35 lines (23 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def extract_implementation(insights):
implementations = []
for s in insights:
if "model" in s.lower() or "method" in s.lower():
implementations.append({
"idea": s,
"pseudo_code": generate_pseudo_code(s),
"difficulty": estimate_difficulty(s)
})
return implementations
def generate_pseudo_code(text):
# simple heuristic
if "panic" in text.lower():
return "panic += nearby_panic * spread_rate"
if "speed" in text.lower():
return "speed *= (1 + panic_factor)"
return "Implement logic based on description"
def estimate_difficulty(text):
if "deep learning" in text.lower():
return "Hard"
elif "model" in text.lower():
return "Medium"
return "Easy"