The dataset viewer is not available for this split.
Error code: FeaturesError Exception: ArrowInvalid Message: JSON parse error: Missing a name for object member. in row 0 Traceback: Traceback (most recent call last): File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 160, in _generate_tables df = pandas_read_json(f) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 38, in pandas_read_json return pd.read_json(path_or_buf, **kwargs) File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 815, in read_json return json_reader.read() File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1025, in read obj = self._get_object_parser(self.data) File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1051, in _get_object_parser obj = FrameParser(json, **kwargs).parse() File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1187, in parse self._parse() File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1403, in _parse ujson_loads(json, precise_float=self.precise_float), dtype=None ValueError: Trailing data During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/src/services/worker/src/worker/job_runners/split/first_rows.py", line 231, in compute_first_rows_from_streaming_response iterable_dataset = iterable_dataset._resolve_features() File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 2998, in _resolve_features features = _infer_features_from_batch(self.with_format(None)._head()) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1918, in _head return _examples_to_batch(list(self.take(n))) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 2093, in __iter__ for key, example in ex_iterable: File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1576, in __iter__ for key_example in islice(self.ex_iterable, self.n - ex_iterable_num_taken): File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 279, in __iter__ for key, pa_table in self.generate_tables_fn(**gen_kwags): File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 163, in _generate_tables raise e File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 137, in _generate_tables pa_table = paj.read_json( File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: JSON parse error: Missing a name for object member. in row 0
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
Datasets are taken from Facebook's CRAG: Comprehensive RAG Benchmark, see their arXiv paper for details about the dataset construction.
CRAG Sampler
We have added a simple Python tool for performing stratified sampling on CRAG data.
Installation
Local Development Install (Recommended)
git clone https://huggingface.co./Quivr/CRAG.git
cd CRAG
pip install -r requirements.txt # Install dependencies
pip install -e . # Install package in development mode
Quick Start
Running the example
python -m examples.basic_sampling
CRAG dataset
CRAG (Comprehensive RAG Benchmark) is a rich and comprehensive factual question answering benchmark designed to advance research in RAG. The public version of the dataset includes:
- 2706 Question-Answer pairs
- 5 domains: Finance, Sports, Music, Movie, and Open domain
- 8 types of questions (see image below): simple, simple with condition, set, comparison, aggregation, multi-hop, post-processing heavy, and false premise
The datasets crag_task_1_and_2_dev_v4_subsample_*.json.bz2
have been created from the dataset crag_task_1_and_2_dev_v4.jsonl.bz2 available on CRAG's GitHub repository.
For an easier handling and download of the dataset, we have used our CRAG sampler to split the 2706 rows of the original file in 5 subsamples, following the procedure below:
- We have created a new label
answer_type
, classifying the answers in 3 categories:invalid
for any answer == "invalid question"no_answer
for any answer == "i don't know"valid
for any other answer
- We have considered the labels
answer_type
,domain
,question_type
andstatic_or_dynamic
and performed stratified sampling, splitting the datasets in 5 subsamples. Each subsample has thus the same statistical properties of the full dataset.
We report below the data schema as provided in CRAG's GitHub repository.
Data Schema
Field Name | Type | Description |
---|---|---|
interaction_id |
string | A unique identifier for each example. |
query_time |
string | Date and time when the query and the web search occurred. |
domain |
string | Domain label for the query. Possible values: "finance", "music", "movie", "sports", "open". "Open" includes any factual queries not among the previous four domains. |
question_type |
string | Type label about the query. Possible values include: "simple", "simple_w_condition", "comparison", "aggregation", "set", "false_premise", "post-processing", "multi-hop". |
static_or_dynamic |
string | Indicates whether the answer to a question changes and the expected rate of change. Possible values: "static", "slow-changing", "fast-changing", and "real-time". |
query |
string | The question for RAG to answer. |
answer |
string | The gold standard answer to the question. |
alt_ans |
list | Other valid gold standard answers to the question. |
split |
integer | Data split indicator, where 0 is for validation and 1 is for the public test. |
search_results |
list of JSON | Contains up to k HTML pages for each query (k=5 for Task #1 and k=50 for Task #3), including page name, URL, snippet, full HTML, and last modified time. |
Search Results Detail
Key | Type | Description |
---|---|---|
page_name |
string | The name of the webpage. |
page_url |
string | The URL of the webpage. |
page_snippet |
string | A short paragraph describing the major content of the page. |
page_result |
string | The full HTML of the webpage. |
page_last_modified |
string | The time when the page was last modified. |
- Downloads last month
- 23