Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,7 @@ NIELIT Major Courses:
|
|
| 15 |
• C Level (M.Tech Equivalent)
|
| 16 |
• Diploma – Hardware, Software, AI, ML, IoT, Cyber Security
|
| 17 |
• Short Courses – Python, Java, C, C++, Web Designing, Data Science
|
|
|
|
| 18 |
""",
|
| 19 |
|
| 20 |
"fees": """
|
|
@@ -22,8 +23,18 @@ NIELIT Fee Structure (Approx):
|
|
| 22 |
• CCC: ₹500–800
|
| 23 |
• O Level: ₹14,000–17,000
|
| 24 |
• A Level: ₹20,000–35,000
|
| 25 |
-
• Diploma
|
| 26 |
-
• Python/Java/AI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
""",
|
| 28 |
|
| 29 |
"ccc": """
|
|
@@ -62,7 +73,7 @@ NIELIT Ropar Courses:
|
|
| 62 |
NIELIT Admission Process:
|
| 63 |
1. Choose Course
|
| 64 |
2. Register Online
|
| 65 |
-
3. Upload
|
| 66 |
4. Pay Fees
|
| 67 |
5. Attend Classes / Exams
|
| 68 |
""",
|
|
@@ -103,14 +114,14 @@ KEYS = list(FAQ.keys())
|
|
| 103 |
def fast_bot(message, history):
|
| 104 |
text = message.lower()
|
| 105 |
|
| 106 |
-
#
|
| 107 |
for key in KEYS:
|
| 108 |
if key in text:
|
| 109 |
answer = FAQ[key]
|
| 110 |
history.append((message, answer))
|
| 111 |
return history, history
|
| 112 |
|
| 113 |
-
# Fuzzy
|
| 114 |
match = get_close_matches(text, KEYS, n=1, cutoff=0.3)
|
| 115 |
if match:
|
| 116 |
answer = FAQ[match[0]]
|
|
@@ -118,18 +129,19 @@ def fast_bot(message, history):
|
|
| 118 |
return history, history
|
| 119 |
|
| 120 |
# Default fallback
|
| 121 |
-
fallback = "Please
|
| 122 |
history.append((message, fallback))
|
| 123 |
return history, history
|
| 124 |
|
|
|
|
| 125 |
# -----------------------------------------------------
|
| 126 |
-
#
|
| 127 |
# -----------------------------------------------------
|
| 128 |
with gr.Blocks() as demo:
|
| 129 |
|
| 130 |
gr.Markdown("""
|
| 131 |
# âš¡ Ultra-Fast NIELIT Chatbot
|
| 132 |
-
### Instant
|
| 133 |
""")
|
| 134 |
|
| 135 |
chat = gr.Chatbot()
|
|
@@ -141,4 +153,3 @@ with gr.Blocks() as demo:
|
|
| 141 |
box.submit(lambda: "", None, box)
|
| 142 |
|
| 143 |
demo.launch()
|
| 144 |
-
|
|
|
|
| 15 |
• C Level (M.Tech Equivalent)
|
| 16 |
• Diploma – Hardware, Software, AI, ML, IoT, Cyber Security
|
| 17 |
• Short Courses – Python, Java, C, C++, Web Designing, Data Science
|
| 18 |
+
• B.Tech Engineering Programs (CS, IT, Electronics) – Center Wise
|
| 19 |
""",
|
| 20 |
|
| 21 |
"fees": """
|
|
|
|
| 23 |
• CCC: ₹500–800
|
| 24 |
• O Level: ₹14,000–17,000
|
| 25 |
• A Level: ₹20,000–35,000
|
| 26 |
+
• Diploma: ₹18,000–45,000
|
| 27 |
+
• Short Courses (Python/Java/AI): ₹1500–6000
|
| 28 |
+
• B.Tech Fee: ₹50,000 per semester
|
| 29 |
+
""",
|
| 30 |
+
|
| 31 |
+
"btech": """
|
| 32 |
+
NIELIT B.Tech Fee & Details:
|
| 33 |
+
• Fee: ₹50,000 per semester
|
| 34 |
+
• Courses: B.Tech in CSE, IT, ECE (center-specific)
|
| 35 |
+
• Duration: 4 Years
|
| 36 |
+
• Admission: JEE / Institute Entrance
|
| 37 |
+
• Facilities: Labs, Project Work, Industry Training
|
| 38 |
""",
|
| 39 |
|
| 40 |
"ccc": """
|
|
|
|
| 73 |
NIELIT Admission Process:
|
| 74 |
1. Choose Course
|
| 75 |
2. Register Online
|
| 76 |
+
3. Upload Documents
|
| 77 |
4. Pay Fees
|
| 78 |
5. Attend Classes / Exams
|
| 79 |
""",
|
|
|
|
| 114 |
def fast_bot(message, history):
|
| 115 |
text = message.lower()
|
| 116 |
|
| 117 |
+
# Direct keyword match
|
| 118 |
for key in KEYS:
|
| 119 |
if key in text:
|
| 120 |
answer = FAQ[key]
|
| 121 |
history.append((message, answer))
|
| 122 |
return history, history
|
| 123 |
|
| 124 |
+
# Fuzzy match
|
| 125 |
match = get_close_matches(text, KEYS, n=1, cutoff=0.3)
|
| 126 |
if match:
|
| 127 |
answer = FAQ[match[0]]
|
|
|
|
| 129 |
return history, history
|
| 130 |
|
| 131 |
# Default fallback
|
| 132 |
+
fallback = "Please check the official website for more details: https://nielit.ac.in"
|
| 133 |
history.append((message, fallback))
|
| 134 |
return history, history
|
| 135 |
|
| 136 |
+
|
| 137 |
# -----------------------------------------------------
|
| 138 |
+
# UI
|
| 139 |
# -----------------------------------------------------
|
| 140 |
with gr.Blocks() as demo:
|
| 141 |
|
| 142 |
gr.Markdown("""
|
| 143 |
# âš¡ Ultra-Fast NIELIT Chatbot
|
| 144 |
+
### Instant Response | Full Course + Fees Info | Includes B.Tech Fees
|
| 145 |
""")
|
| 146 |
|
| 147 |
chat = gr.Chatbot()
|
|
|
|
| 153 |
box.submit(lambda: "", None, box)
|
| 154 |
|
| 155 |
demo.launch()
|
|
|