MakPr016 commited on
Commit
d67b274
·
1 Parent(s): d710e75

v2: Upgraded to retrained model with improved PO6-PO11 accuracy, updated NBA definitions

Browse files
Files changed (1) hide show
  1. app.py +187 -25
app.py CHANGED
@@ -9,40 +9,202 @@ import re
9
 
10
 
11
  OFFICIAL_PO_DEFINITIONS = {
12
- "PO1": "Apply knowledge of mathematics, natural science, computing, engineering fundamentals and an engineering specialization to solve complex engineering problems",
13
- "PO2": "Identify, formulate, review research literature and analyze complex engineering problems reaching substantiated conclusions",
14
- "PO3": "Design creative solutions for complex engineering problems and design systems, components or processes to meet identified needs",
15
- "PO4": "Conduct investigations of complex engineering problems using research-based knowledge including design of experiments, analysis and interpretation of data",
16
- "PO5": "Create, select and apply appropriate techniques, resources and modern engineering IT tools to solve complex engineering problems",
17
- "PO6": "Analyze societal, environmental and sustainability aspects while solving complex engineering problems",
18
- "PO7": "Apply ethical principles and commit to professional ethics and human values",
19
- "PO8": "Function effectively as an individual and as a member or leader in diverse teams",
20
- "PO9": "Communicate effectively with the engineering community and society",
21
- "PO10": "Apply engineering management principles and economic decision-making to manage projects",
22
- "PO11": "Recognize the need for independent lifelong learning and adaptability to emerging technologies"
23
  }
24
 
25
-
26
  PO_KEYWORDS = {
27
- "PO1": ["knowledge", "mathematics", "math", "science", "computing", "engineering", "fundamental", "theory", "concept", "principle", "algorithm", "data structure", "programming", "software", "hardware", "circuit", "system", "analysis", "understand", "explain", "apply", "technical", "computer"],
28
- "PO2": ["identify", "formulate", "analyze", "analysis", "problem", "research", "investigate", "investigation", "examine", "evaluate", "evaluation", "assess", "assessment", "literature", "study", "review", "complex"],
29
- "PO3": ["design", "create", "develop", "build", "implement", "implementation", "construct", "architecture", "model", "prototype", "system", "component", "solution", "innovative", "creative", "synthesize"],
30
- "PO4": ["experiment", "test", "testing", "measure", "measurement", "data", "analysis", "interpret", "interpretation", "validation", "verify", "verification", "research", "investigation", "empirical", "benchmark", "evaluate"],
31
- "PO5": ["tool", "tools", "technology", "software", "framework", "platform", "library", "IDE", "programming", "language", "modern", "technique", "method", "approach", "implement", "application", "use", "utilize"],
32
- "PO6": ["society", "social", "environmental", "environment", "sustainability", "sustainable", "impact", "ethical", "responsible", "responsibility", "green", "energy", "carbon", "climate", "eco", "community", "culture", "global"],
33
- "PO7": ["ethics", "ethical", "professional", "integrity", "responsibility", "responsible", "conduct", "moral", "morality", "values", "principles", "principle", "honesty", "fairness", "accountability", "code of conduct"],
34
- "PO8": ["team", "teams", "collaborate", "collaboration", "cooperative", "cooperation", "group", "leadership", "leader", "member", "members", "teamwork", "collective", "peer", "diverse", "diversity", "multicultural", "together"],
35
- "PO9": ["communicate", "communication", "present", "presentation", "document", "documentation", "report", "write", "writing", "speak", "speaking", "explain", "articulate", "technical writing", "stakeholder", "audience"],
36
- "PO10": ["project", "projects", "management", "manage", "plan", "planning", "schedule", "scheduling", "resource", "resources", "budget", "cost", "timeline", "milestone", "risk", "decision", "economic", "strategy", "organize", "organization"],
37
- "PO11": ["learning", "learn", "adapt", "adapting", "adaptability", "emerging", "new", "continuous", "lifelong", "skill", "skills", "development", "growth", "technology", "technologies", "trend", "trends", "innovation", "self-learn", "update", "evolve", "change"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  }
39
 
40
-
41
  class FineTunedCOPOMapper:
42
  def __init__(self):
43
  hf_token = os.environ.get("HF_TOKEN")
44
  print("Loading private model from Hugging Face...")
45
- self.model = SentenceTransformer("MakPr016/co-po-finetuned-model", use_auth_token=hf_token)
46
  print("Model loaded successfully!")
47
  self.po_embeddings = {}
48
  self._precompute_po_embeddings()
 
9
 
10
 
11
  OFFICIAL_PO_DEFINITIONS = {
12
+ "PO1": "Apply the knowledge of mathematics, science, engineering fundamentals, and an engineering specialization to the solution of complex engineering problems",
13
+ "PO2": "Identify, formulate, review research literature, and analyze complex engineering problems reaching substantiated conclusions using first principles of mathematics, natural sciences, and engineering sciences",
14
+ "PO3": "Design solutions for complex engineering problems and design system components or processes that meet the specified needs with appropriate consideration for the public health and safety, and the cultural, societal, and environmental considerations",
15
+ "PO4": "Use research-based knowledge and research methods including design of experiments, analysis and interpretation of data, and synthesis of the information to provide valid conclusions",
16
+ "PO5": "Create, select, and apply appropriate techniques, resources, and modern engineering and IT tools including prediction and modeling to complex engineering activities with an understanding of the limitations",
17
+ "PO6": "Apply reasoning informed by the contextual knowledge to assess societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional engineering practice",
18
+ "PO7": "Understand the impact of the professional engineering solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable development",
19
+ "PO8": "Apply ethical principles and commit to professional ethics and responsibilities and norms of the engineering practice",
20
+ "PO9": "Function effectively as an individual, and as a member or leader in diverse teams, and in multidisciplinary settings",
21
+ "PO10": "Communicate effectively on complex engineering activities with the engineering community and with society at large, such as, being able to comprehend and write effective reports and design documentation, make effective presentations, and give and receive clear instructions",
22
+ "PO11": "Demonstrate knowledge and understanding of the engineering and management principles and apply these to one's own work, as a member and leader in a team, to manage projects and in multidisciplinary environments"
23
  }
24
 
 
25
  PO_KEYWORDS = {
26
+ "PO1": [
27
+ "knowledge", "mathematics", "math", "science", "computing", "engineering",
28
+ "fundamental", "theory", "concept", "principle", "algorithm", "data structure",
29
+ "programming", "software", "hardware", "circuit", "system", "analysis",
30
+ "understand", "explain", "apply", "technical", "computer",
31
+ "physics", "chemistry", "material", "thermodynamics", "mechanics", "electricity",
32
+ "waves", "optics", "equilibrium", "conservation", "kinetics", "diffusion",
33
+ "reaction rates", "calculus", "linear algebra", "differential equations",
34
+ "probability", "statistics", "regression", "interpolation", "transforms",
35
+ "numerical", "integration", "error analysis", "kinematics", "dynamics",
36
+ "fluid flow", "heat transfer", "stress", "strain", "control", "signals",
37
+ "embedded", "database", "OS", "VLSI", "power systems", "machine design",
38
+ "networking", "modelling", "compute", "derive", "formulate", "validate",
39
+ "solve", "approximation", "assumptions", "constraints", "simulation",
40
+ "optimization", "verification", "problem-solving", "quantitative",
41
+ "dimensional", "specialization", "theory-based", "unit analysis",
42
+ "abstraction", "material properties", "conservation laws", "estimation",
43
+ "numerical methods", "numerical integration", "circuits", "control basics",
44
+ "embedded basics", "OS concepts", "data structures", "advanced tools", "codes"
45
+ ],
46
+
47
+ "PO2": [
48
+ "identify", "formulate", "analyze", "analysis", "problem", "research",
49
+ "investigate", "investigation", "examine", "evaluate", "evaluation", "assess",
50
+ "assessment", "literature", "study", "review", "complex", "assumptions",
51
+ "constraints", "requirements", "decompose", "root cause", "hypothesis",
52
+ "criteria", "metrics", "trade-offs", "case analysis", "feasibility", "risk",
53
+ "sustainability", "data gathering", "pattern recognition", "model selection",
54
+ "verification", "validation", "evidence", "argumentation", "conclusion",
55
+ "justification", "sensitivity", "sensitivity analysis", "physical principles",
56
+ "experimental", "measurement", "uncertainty", "empirical", "statistical",
57
+ "hypothesis testing", "confidence intervals", "correlation", "multivariate",
58
+ "error propagation", "failure modes", "load cases", "boundary conditions",
59
+ "specifications", "performance limits", "safety factors", "standards",
60
+ "cybersecurity", "grid stability", "bioprocess", "substantiated",
61
+ "phenomena", "empirical evidence", "statistical analysis", "standards baseline",
62
+ "domain constraints", "complex scenarios", "advanced methods", "first principles",
63
+ "literature review", "complex problems"
64
+ ],
65
+
66
+ "PO3": [
67
+ "design", "create", "develop", "build", "implement", "implementation",
68
+ "construct", "architecture", "model", "prototype", "system", "component",
69
+ "solution", "innovative", "creative", "synthesize", "specification",
70
+ "requirements", "constraints", "whole-life cost", "net zero", "sustainability",
71
+ "public health", "safety", "stakeholder", "trade-off", "optimization",
72
+ "feasibility", "innovation", "integration", "standards", "compliance",
73
+ "documentation", "design process", "cost analysis", "environmental impact",
74
+ "resource efficiency", "life-cycle assessment", "manufacturability",
75
+ "maintainability", "codes", "project management", "plan", "propose",
76
+ "integrate", "optimize", "specify", "creative solutions", "system components",
77
+ "processes", "meet needs", "appropriate consideration", "cultural",
78
+ "societal", "environmental considerations"
79
+ ],
80
+
81
+ "PO4": [
82
+ "experiment", "test", "testing", "measure", "measurement", "data", "analysis",
83
+ "interpret", "interpretation", "validation", "verify", "verification",
84
+ "research", "investigation", "empirical", "benchmark", "evaluate",
85
+ "experimental design", "hypothesis testing", "methodology", "data collection",
86
+ "analyze data", "validate", "model calibration", "research-based",
87
+ "literature review", "protocol", "observation", "inference", "reproducibility",
88
+ "documentation", "research methodology", "peer review", "experimental setup",
89
+ "critical review", "emerging issues", "investigate", "calibrate",
90
+ "design of experiments", "synthesis", "synthesis of information",
91
+ "valid conclusions", "research methods", "research-based knowledge",
92
+ "interpretation of data"
93
+ ],
94
+
95
+ "PO5": [
96
+ "tool", "tools", "technology", "software", "framework", "platform", "library",
97
+ "IDE", "programming", "language", "modern", "technique", "method", "approach",
98
+ "implement", "application", "use", "utilize", "simulate", "modeling",
99
+ "calibrate", "CAD", "CAE", "algorithm", "limitations", "benchmarking",
100
+ "tool selection", "automation", "digital twin", "data visualization",
101
+ "computation", "process", "manufacturing", "deployment", "instrumentation",
102
+ "digital tools", "operate", "program", "automate", "simulation",
103
+ "modern engineering tools", "IT tools", "prediction", "modeling",
104
+ "understanding limitations", "CAD/CAE tools", "modern techniques",
105
+ "appropriate techniques", "resources", "complex engineering activities"
106
+ ],
107
+
108
+ "PO6": [
109
+ "society", "social", "environmental", "environment", "sustainability",
110
+ "sustainable", "impact", "ethical", "responsible", "responsibility",
111
+ "green", "energy", "carbon", "climate", "eco", "community", "culture",
112
+ "global", "societal impact", "legal", "health", "safety", "cultural",
113
+ "economic impacts", "standards", "compliance", "lifecycle assessment",
114
+ "regulation", "public welfare", "risk assessment", "ethics", "policy",
115
+ "public health", "safety standards", "cost-benefit", "resource allocation",
116
+ "EIA", "legal framework", "assess", "justify", "comply", "recommend",
117
+ "judge", "critique", "environmental science", "reasoning", "contextual knowledge",
118
+ "societal issues", "health issues", "safety issues", "legal issues",
119
+ "cultural issues", "consequent responsibilities", "professional engineering practice",
120
+ "engineer and society"
121
+ ],
122
+
123
+ "PO7": [
124
+ "sustainability", "environmental impact", "resource efficiency", "renewable",
125
+ "pollution", "waste management", "climate change", "conservation",
126
+ "life-cycle assessment", "green design", "eco-friendly", "regulatory compliance",
127
+ "sustainable development", "carbon footprint", "circular economy",
128
+ "biodiversity", "ecosystem", "environmental degradation", "clean energy",
129
+ "water conservation", "soil conservation", "regulation", "public welfare",
130
+ "green technology", "climate policy", "renewable resources",
131
+ "ecological balance", "professional engineering solutions",
132
+ "societal contexts", "environmental contexts", "knowledge of sustainable development",
133
+ "need for sustainable development", "understand impact"
134
+ ],
135
+
136
+ "PO8": [
137
+ "ethics", "ethical", "professional", "integrity", "responsibility",
138
+ "responsible", "conduct", "moral", "morality", "values", "principles",
139
+ "principle", "honesty", "fairness", "accountability", "code of conduct",
140
+ "inclusivity", "diversity", "compliance", "governance", "transparency",
141
+ "confidentiality", "conflict of interest", "professional ethics",
142
+ "moral values", "ethical behavior", "ethical dilemma", "social responsibility",
143
+ "professional standards", "code of conduct", "bias mitigation",
144
+ "inclusive behavior", "professional responsibility", "ethical decision-making",
145
+ "professional norms", "ethical framework", "adhere", "demonstrate",
146
+ "respect", "reflect", "act", "commit", "advocate", "ethical principles",
147
+ "commit to ethics", "norms of engineering practice", "professional ethics and responsibilities"
148
+ ],
149
+
150
+ "PO9": [
151
+ "team", "teams", "collaborate", "collaboration", "cooperative", "cooperation",
152
+ "group", "leadership", "leader", "member", "members", "teamwork", "collective",
153
+ "peer", "diverse", "diversity", "multicultural", "together", "coordinate",
154
+ "roles", "team dynamics", "multidisciplinary", "conflict resolution",
155
+ "accountability", "contribution", "communication", "delegation", "motivation",
156
+ "feedback", "participation", "project management", "multidisciplinary integration",
157
+ "cooperate", "lead", "participate", "contribute", "support", "facilitate",
158
+ "manage", "team building", "interpersonal skills", "group work",
159
+ "team coordination", "collaborative problem-solving", "function effectively",
160
+ "individual", "member or leader", "diverse teams", "multidisciplinary settings"
161
+ ],
162
+
163
+ "PO10": [
164
+ "communicate", "communication", "present", "presentation", "document",
165
+ "documentation", "report", "write", "writing", "speak", "speaking",
166
+ "explain", "articulate", "technical writing", "stakeholder", "audience",
167
+ "clarity", "visualization", "inclusivity", "language differences",
168
+ "comprehension", "oral communication", "written communication", "feedback",
169
+ "listening", "negotiation", "reporting", "audience analysis", "illustrate",
170
+ "summarize", "interpret", "discuss", "listen", "effective communication",
171
+ "clear instructions", "design documentation", "presentation skills",
172
+ "effective reports", "communicate effectively", "engineering community",
173
+ "society at large", "comprehend", "write effective reports",
174
+ "make effective presentations", "give and receive instructions",
175
+ "complex engineering activities"
176
+ ],
177
+
178
+ "PO11": [
179
+ "project", "projects", "management", "manage", "plan", "planning", "schedule",
180
+ "scheduling", "resource", "resources", "budget", "cost", "timeline", "milestone",
181
+ "risk", "decision", "economic", "strategy", "organize", "organization",
182
+ "cost analysis", "resource allocation", "feasibility", "management principles",
183
+ "economics", "decision-making", "leadership", "project execution", "monitoring",
184
+ "evaluation", "procurement", "stakeholder management", "cost estimation",
185
+ "budgeting", "risk management", "allocate", "execute", "coordinate",
186
+ "financial management", "project planning", "learning", "learn", "adapt",
187
+ "adapting", "adaptability", "emerging", "new", "continuous", "lifelong",
188
+ "skill", "skills", "development", "growth", "technology", "technologies",
189
+ "trend", "trends", "innovation", "self-learn", "update", "evolve", "change",
190
+ "technological change", "keep abreast", "critical thinking", "reflect",
191
+ "independent learning", "update skills", "professional development", "curiosity",
192
+ "continuous improvement", "resilience", "self-learning", "independent study",
193
+ "critical review", "emerging issues", "reflection", "continuous learning",
194
+ "skill enhancement", "knowledge updating", "pursue", "explore", "inquire",
195
+ "improve", "recognize need", "preparation", "ability to engage",
196
+ "independent learning", "life-long learning", "broadest context",
197
+ "engineering and management principles", "apply to own work",
198
+ "member and leader in team", "manage projects", "multidisciplinary environments",
199
+ "emerging technologies"
200
+ ]
201
  }
202
 
 
203
  class FineTunedCOPOMapper:
204
  def __init__(self):
205
  hf_token = os.environ.get("HF_TOKEN")
206
  print("Loading private model from Hugging Face...")
207
+ self.model = SentenceTransformer("MakPr016/co-po-finetuned-model-v2", use_auth_token=hf_token)
208
  print("Model loaded successfully!")
209
  self.po_embeddings = {}
210
  self._precompute_po_embeddings()