Spaces:
Runtime error
Runtime error
Download tutorial.py from CreatorPhan/VDT: direct link, hf CLI and curl.
- Browser
- Download file 360 Bytes
-
https://huggingface.co/spaces/CreatorPhan/VDT/resolve/refs%2Fpr%2F1/tutorial.py
- Command line
-
hf download hf://spaces/CreatorPhan/VDT@refs/pr/1/tutorial.py
-
curl -L -o tutorial.py https://huggingface.co/spaces/CreatorPhan/VDT/resolve/refs%2Fpr%2F1/tutorial.py
360 Bytes
| from retrieval.retrieval import Retrieval, BM25 | |
| # retrieval = Retrieval(k=4) | |
| # contexts = retrieval.get_context() | |
| docs = open('../document2.txt', encoding='utf-8').read() | |
| retrieval = Retrieval(docs=docs) | |
| # retrieval.tuning(docs) | |
| contexts = retrieval.get_context("Khi nào bệnh nhên nên đến bệnh viện?") | |
| for context in contexts: | |
| print(context) |