haystack/test/samples/schema/table_label.json
Sebastian a67ca289db
refactor: Update schema objects to handle Dataframes in to_{dict,json} and from_{dict,json} (#4747)
* Adding support for table Documents when serializing Labels in Haystack

* Fix table label equality test

* Add serialization support and __eq__ support for table answers

* Made convenience functions for converting dataframes. Added some TODOs. Epxanded schema tests for table labels. Updated Multilabel to not convert Dataframes into strings.

* get Answer and Label to_json working with DataFrame

* Fix from_dict method of Label

* Use Dict and remove unneccessary if check

* Using pydantic instead of builtins for type detection

* Update haystack/schema.py

Co-authored-by: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com>

* Update haystack/schema.py

Co-authored-by: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com>

* Update haystack/schema.py

Co-authored-by: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com>

* Separated table label equivalency tests and added pytest.mark.unit


* Added unit test for _dict_factory

* Using more descriptive variable names

* Adding json files to test to_json and from_json functions

* Added sample files for tests

---------

Co-authored-by: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com>
2023-05-03 09:42:07 +02:00

67 lines
1.0 KiB
JSON

{
"id": "fbd79f71-d690-4b21-bd0a-1094292b9809",
"query": "some",
"document": {
"id": "fe5cb68f8226776914781f6bd40ad718",
"content": [
[
"col1",
"col2"
],
[
"text_1",
1
],
[
"text_2",
2
]
],
"content_type": "table",
"meta": {},
"id_hash_keys": [
"content"
],
"score": null,
"embedding": null
},
"is_correct_answer": true,
"is_correct_document": true,
"origin": "user-feedback",
"answer": {
"answer": "text_2",
"type": "extractive",
"score": 0.1,
"context": [
[
"col1",
"col2"
],
[
"text_1",
1
],
[
"text_2",
2
]
],
"offsets_in_document": [
{
"row": 1,
"col": 0
}
],
"offsets_in_context": null,
"document_ids": [
"123"
],
"meta": {}
},
"pipeline_id": null,
"created_at": "2023-05-02 11:43:56",
"updated_at": null,
"meta": {},
"filters": null
}