Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: vi
|
| 3 |
+
tags:
|
| 4 |
+
- faiss
|
| 5 |
+
- passages
|
| 6 |
+
- vietnamese
|
| 7 |
+
- question-answering
|
| 8 |
+
- retrieval
|
| 9 |
+
license: mit
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# HUMG Search Data
|
| 13 |
+
|
| 14 |
+
Dữ liệu tìm kiếm cho hệ thống Hỏi-đáp Quy chế Đào tạo HUMG.
|
| 15 |
+
|
| 16 |
+
## Nội dung
|
| 17 |
+
- `passages.json` – Bộ passages (đoạn văn bản) từ Quy chế Đào tạo
|
| 18 |
+
- `faiss_index.ivf` – FAISS IVF index đã được build sẵn
|
| 19 |
+
- `passage_id_map.json` – Ánh xạ FAISS index ID → passage ID
|
| 20 |
+
- `passage_embeddings.npy` – Vector embeddings của các passages
|
| 21 |
+
|
| 22 |
+
## Cách sử dụng
|
| 23 |
+
```python
|
| 24 |
+
import json
|
| 25 |
+
import faiss
|
| 26 |
+
from huggingface_hub import hf_hub_download
|
| 27 |
+
|
| 28 |
+
# Download files
|
| 29 |
+
faiss_path = hf_hub_download(repo_id="mudotet/humg-search-data", filename="faiss_index.ivf", repo_type="dataset")
|
| 30 |
+
passages_path = hf_hub_download(repo_id="mudotet/humg-search-data", filename="passages.json", repo_type="dataset")
|
| 31 |
+
id_map_path = hf_hub_download(repo_id="mudotet/humg-search-data", filename="passage_id_map.json", repo_type="dataset")
|
| 32 |
+
|
| 33 |
+
# Load
|
| 34 |
+
index = faiss.read_index(faiss_path)
|
| 35 |
+
with open(passages_path, "r", encoding="utf-8") as f:
|
| 36 |
+
passages = json.load(f)
|
| 37 |
+
with open(id_map_path, "r", encoding="utf-8") as f:
|
| 38 |
+
id_map = json.load(f)
|
| 39 |
+
```
|