File size: 2,743 Bytes
224e432
e98d6c0
224e432
 
 
 
e98d6c0
224e432
 
 
 
af7ef07
224e432
 
80a940f
e98d6c0
 
 
80a940f
 
 
 
 
 
 
 
e98d6c0
a303f5f
80a940f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a303f5f
80a940f
 
 
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
title: 🐘 Laos Natural Science Chatbot 
emoji: 💬
colorFrom: yellow
colorTo: purple
sdk: gradio
sdk_version: 6.1.0
app_file: app.py
pinned: false
hf_oauth: true
hf_oauth_scopes:
- inference-api
---


# 🐘 Laos Natural Science Chatbot (ວິທະຍາສາດ ທຳມະຊາດ ມ.1-ມ.4)

Chatbot ຕົວນີ້ອອກແບບສໍາລັບນັກຮຽນຊັ້ນ ມ.1-ມ.4  ໃນວິຊາວິທະຍາສາດທຳມະຊາດພາສາລາວ
ໃຊ້ SeaLLM + JSONL ຂໍ້ມູນຈາກຕໍາລາປະຫວັດສາດ ແລະ Q&A ທີ່ຄູເພີ່ມເອງ (Teacher Panel)  
ພັດທະນາດ້ວຍ [Gradio](https://gradio.app) ແລະເຮັດວຽກໃນ Hugging Face Spaces.

---

## ✨ Features

- 👩‍🎓 **Student Chat**
  - ນັກຮຽນຖາມຄໍາຖາມວິທະຍາສາດທຳມະຊາດເປັນພາສາລາວ
  - ຄໍາຕອບສັ້ນໆ 2–3 ປະໂຫຍກ ເຂົ້າໃຈງ່າຍ ເໝາະກັບນັກຮຽນ ມ.1-ມ.4
  - ອີງຈາກຂໍ້ມູນໃນ JSONL ຕໍາລາ + Q&A ທີ່ຄູຕັ້ງໄວ້

- 👩‍🏫 **Teacher Panel**
  - ເພີ່ມ / ແກ້ໄຂ / ລຶບ Q&A ມື (บັນທຶກໃນ `data/manual_qa.jsonl`)
  - ຄໍາຕອບໃໝ່ຖືກນໍາໃຊ້ທັນທີໃນ Student Chat
  - ເບິ່ງຕາຕະລາງ Q&A ທັງໝົດ ແລະເລືອກແຖວເພື່ອແກ້ໄຂ

- 🧠 **RAG + Embeddings**
  - ດຶງຂໍ້ມູນຈາກ JSONL ຕໍາລາດ້ວຍ sentence-transformers (embedding-based retrieval)
  - ເລືອກຊິ້ນຂໍ້ມູນ (entries) ທີ່ໃກ້ຄຽງກັບຄໍາຖາມທີ່ສຸດ
  - ໃຊ້ SeaLLM ຕອບຄໍາຖາມໂດຍອີງຈາກ context ເຫຼົ່ານີ້

---

## 📁 Project structure

```text
laos-history-chatbot/
├── app.py                 # Gradio UI (Student Chat + Teacher Panel)
├── model_utils.py         # SeaLLM, RAG, embeddings, chatbot logic
├── loader.py              # Load textbook JSONL + manual_qa.jsonl
├── qa_store.py            # In-memory storage & normalize_question
├── teacher_panel.py       # Teacher Panel actions (save/update/delete/select)
├── data/
│   ├── 1_Year_U_1.jsonl   # Curriculum (textbook) data
        ... (Still have more jsonl that I have to add)
│   └── manual_qa.jsonl    # Manual Q&A from teachers
├── requirements.txt       # Python dependencies
└── README.md              # This file