Spaces:
Sleeping
Sleeping
teaching_plan_chatbot_package
#1
by sujithblore - opened
- .gitattributes +0 -5
- AIN7301_PythonProgramming_TP_26Nov2025.docx +0 -3
- AIN7303_MLDLTechniques_TP_v1.docx +0 -3
- AIN7304_Responsible AI_TP_28Nov2025.docx +0 -3
- COM7301_ProfessionalPractice_TeachingPlan_Final_28Oct2025.docx +0 -0
- COM7302_AppliedAI_ResearchMethodology_TP_Final_09Nov2025.docx +0 -0
- COM7303_Statistics_TP_29Dec2025.docx +0 -3
- DAT7301_DADVisualization_TP_v1.docx +0 -3
- app.py +6 -5
- teaching_plan +0 -0
.gitattributes
CHANGED
|
@@ -33,8 +33,3 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
-
AIN7301_PythonProgramming_TP_26Nov2025.docx filter=lfs diff=lfs merge=lfs -text
|
| 37 |
-
AIN7303_MLDLTechniques_TP_v1.docx filter=lfs diff=lfs merge=lfs -text
|
| 38 |
-
AIN7304_Responsible[[:space:]]AI_TP_28Nov2025.docx filter=lfs diff=lfs merge=lfs -text
|
| 39 |
-
COM7303_Statistics_TP_29Dec2025.docx filter=lfs diff=lfs merge=lfs -text
|
| 40 |
-
DAT7301_DADVisualization_TP_v1.docx filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AIN7301_PythonProgramming_TP_26Nov2025.docx
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:9d8e25c698daf3fad3728a19aa2b7a9b6edfe63457b97668ee41028f8ee2f583
|
| 3 |
-
size 279183
|
|
|
|
|
|
|
|
|
|
|
|
AIN7303_MLDLTechniques_TP_v1.docx
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:20cd57501f80a9e81060e4af00a75fbadf1154ef7ce53a97a484f7876a52c83a
|
| 3 |
-
size 282868
|
|
|
|
|
|
|
|
|
|
|
|
AIN7304_Responsible AI_TP_28Nov2025.docx
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:672bacb4d4770f0b28b9dded5292e98c29df6078e8dddbe0b47dc5e126d53895
|
| 3 |
-
size 280396
|
|
|
|
|
|
|
|
|
|
|
|
COM7301_ProfessionalPractice_TeachingPlan_Final_28Oct2025.docx
DELETED
|
Binary file (71.3 kB)
|
|
|
COM7302_AppliedAI_ResearchMethodology_TP_Final_09Nov2025.docx
DELETED
|
Binary file (47.3 kB)
|
|
|
COM7303_Statistics_TP_29Dec2025.docx
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:69d811fc5a27f9b89fcbc0e552e2fcb2d6e34e5a5c43e5f6183a21ea52c9e043
|
| 3 |
-
size 288973
|
|
|
|
|
|
|
|
|
|
|
|
DAT7301_DADVisualization_TP_v1.docx
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:7eab89cb6a4e4375e0bbd3d09fd308e1ba1ad32f5e98f4c6c2d50fcc4e657c67
|
| 3 |
-
size 284769
|
|
|
|
|
|
|
|
|
|
|
|
app.py
CHANGED
|
@@ -17,7 +17,7 @@ from pypdf import PdfReader
|
|
| 17 |
# ------------------------------------------------------------
|
| 18 |
APP_TITLE = "MAIAD01 Teaching Plan Chatbot"
|
| 19 |
FAQ_FILE = "faq.csv"
|
| 20 |
-
TEACHING_PLAN_DIR = "
|
| 21 |
|
| 22 |
EMBEDDING_MODEL = "sentence-transformers/all-MiniLM-L6-v2"
|
| 23 |
|
|
@@ -382,15 +382,16 @@ def similarity_search(
|
|
| 382 |
def format_faq_answer(row: pd.Series, score: float, show_sources: bool) -> str:
|
| 383 |
answer = str(row["answer"]).strip()
|
| 384 |
|
|
|
|
| 385 |
if show_sources:
|
| 386 |
footer = (
|
| 387 |
"\n\n---\n"
|
| 388 |
f"**Source:** {row['source_file']} \n"
|
| 389 |
-
f"**Category:** {row['category']}"
|
|
|
|
| 390 |
)
|
| 391 |
-
return f"{answer}{footer}"
|
| 392 |
|
| 393 |
-
return answer
|
| 394 |
|
| 395 |
|
| 396 |
def generate_answer_from_chunks(question: str, chunks_with_scores: List[Tuple[Dict, float]]) -> str:
|
|
@@ -523,7 +524,7 @@ demo = gr.ChatInterface(
|
|
| 523 |
label="Course filter"
|
| 524 |
),
|
| 525 |
gr.Checkbox(
|
| 526 |
-
value=
|
| 527 |
label="Show teaching-plan sources"
|
| 528 |
)
|
| 529 |
],
|
|
|
|
| 17 |
# ------------------------------------------------------------
|
| 18 |
APP_TITLE = "MAIAD01 Teaching Plan Chatbot"
|
| 19 |
FAQ_FILE = "faq.csv"
|
| 20 |
+
TEACHING_PLAN_DIR = "teaching_plans"
|
| 21 |
|
| 22 |
EMBEDDING_MODEL = "sentence-transformers/all-MiniLM-L6-v2"
|
| 23 |
|
|
|
|
| 382 |
def format_faq_answer(row: pd.Series, score: float, show_sources: bool) -> str:
|
| 383 |
answer = str(row["answer"]).strip()
|
| 384 |
|
| 385 |
+
footer = ""
|
| 386 |
if show_sources:
|
| 387 |
footer = (
|
| 388 |
"\n\n---\n"
|
| 389 |
f"**Source:** {row['source_file']} \n"
|
| 390 |
+
f"**Category:** {row['category']} \n"
|
| 391 |
+
f"**FAQ match score:** {score:.2f}"
|
| 392 |
)
|
|
|
|
| 393 |
|
| 394 |
+
return f"{answer}{footer}"
|
| 395 |
|
| 396 |
|
| 397 |
def generate_answer_from_chunks(question: str, chunks_with_scores: List[Tuple[Dict, float]]) -> str:
|
|
|
|
| 524 |
label="Course filter"
|
| 525 |
),
|
| 526 |
gr.Checkbox(
|
| 527 |
+
value=True,
|
| 528 |
label="Show teaching-plan sources"
|
| 529 |
)
|
| 530 |
],
|
teaching_plan
DELETED
|
File without changes
|