|
Download README.md from lance-format/truthful-qa-lance: direct link, hf CLI and curl.
- Browser
- Download file 3.58 kB
-
https://huggingface.co/datasets/lance-format/truthful-qa-lance/resolve/main/README.md
- Command line
-
hf download hf://datasets/lance-format/truthful-qa-lance/README.md
-
curl -L -o README.md https://huggingface.co/datasets/lance-format/truthful-qa-lance/resolve/main/README.md
3.58 kB
| pretty_name: TruthfulQA in Lance | |
| license: apache-2.0 | |
| language: | |
| - en | |
| task_categories: | |
| - question-answering | |
| - text-generation | |
| - multiple-choice | |
| tags: | |
| - lance | |
| - benchmark | |
| - information-retrieval | |
| - truthfulness | |
| size_categories: | |
| - 1K<n<10K | |
| configs: | |
| - config_name: generation | |
| data_files: | |
| - split: validation | |
| path: viewer/generation/validation-00000-of-00001.parquet | |
| - config_name: multiple_choice | |
| data_files: | |
| - split: validation | |
| path: viewer/multiple_choice/validation-00000-of-00001.parquet | |
| # TruthfulQA in Lance | |
| Find TruthfulQA benchmark questions by topic, then read their benchmark category and reference answers. [Pinned original dataset](https://huggingface.co/datasets/truthfulqa/truthful_qa/tree/741b8276f2d1982aa3d5b832d3ee81ed3b896490) | |
| ## Data and splits | |
| | Source configuration | Split | Rows | Lance table | | |
| |---|---|---:|---| | |
| | `generation` | `validation` | 817 | [`data/generation/validation.lance`](data/generation/validation.lance) | | |
| | `multiple_choice` | `validation` | 817 | [`data/multiple_choice/validation.lance`](data/multiple_choice/validation.lance) | | |
| Both configurations keep every original field, row, and row order. The generation configuration includes the question, category, reference answers, and intentionally incorrect benchmark answers. The multiple-choice configuration preserves both sets of choices and labels. The `source_row` column gives the original zero-based row position within each configuration. [Conversion manifest and source checksums](meta/conversion.json) | |
| Hugging Face Data Studio reads the byte-identical original Parquet files in `viewer/`. [Open the preview](https://huggingface.co/datasets/lance-format/truthful-qa-lance/viewer/generation/validation) | |
| ## Search in Python | |
| The release generates a 1024-dimensional, L2-normalized float32 vector from each original English `question`. It uses `sentence-transformers/static-retrieval-mrl-en-v1` at revision `f60985c706f192d45d218078e49e5a8b6f15283a`. Search ranks by cosine distance and prints cosine similarity as `1 - distance`. [Pinned encoder](https://huggingface.co/sentence-transformers/static-retrieval-mrl-en-v1/tree/f60985c706f192d45d218078e49e5a8b6f15283a) | |
| ```bash | |
| pip install pylance==14.0.3 sentence-transformers==6.3.0 | |
| ``` | |
| ```python | |
| import lance | |
| from sentence_transformers import SentenceTransformer | |
| encoder = SentenceTransformer( | |
| "sentence-transformers/static-retrieval-mrl-en-v1", | |
| revision="f60985c706f192d45d218078e49e5a8b6f15283a", | |
| device="cpu", | |
| ) | |
| query = "Common misconceptions about the planets and the motion of Earth." | |
| vector = encoder.encode_query(query, normalize_embeddings=True) | |
| dataset = lance.dataset("hf://datasets/lance-format/truthful-qa-lance/data/generation/validation.lance") | |
| hits = dataset.to_table( | |
| columns=["source_row", "question", "category", "best_answer", "_distance"], | |
| nearest={"column": "embedding", "q": vector, "k": 5, "metric": "cosine"}, | |
| ).to_pylist() | |
| for hit in hits: | |
| print(f"{1.0 - hit['_distance']:.4f} row={hit['source_row']} {hit['category']}") | |
| print(hit["question"]) | |
| print(f"Benchmark answer: {hit['best_answer']}") | |
| ``` | |
| ## Attribution and license | |
| Credit Stephanie Lin, Jacob Hilton, and Owain Evans for *TruthfulQA: Measuring How Models Mimic Human Falsehoods*. The authors release the source under Apache 2.0. This conversion adds a split-local identifier and the retrieval embedding. [License](LICENSE) · [Original dataset card](source/README.md) · [Authors' repository](https://github.com/sylinrl/TruthfulQA) · [Paper](https://arxiv.org/abs/2109.07958) | |