How to define meta in Haystack JsonConverter API #6402
Unanswered
allenwsh82
asked this question in
Questions
Replies: 1 comment
-
Hello... I would try something like this: from haystack.nodes import JsonConverter
converter = JsonConverter()
docs = converter.convert("data_file.json", meta=YOUR-META-DICT) If your metadata is stored in a JSON file, you first need to convert it into a dict: import json
with open("metadata.json") as f_in:
metadata_dict = json.load(f_in) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello Guys,
Any idea how to define 'meta' for this API function?
def convert(file_path: Path,
meta: Optional[Dict[str, Any]] = None,
remove_numeric_tables: Optional[bool] = None,
valid_languages: Optional[List[str]] = None,
encoding: Optional[str] = "UTF-8",
id_hash_keys: Optional[List[str]] = None) -> List[Document]
Take for example of this json file attached.
meta_Magazine_Subscriptions.json
meta_Magazine_Subscriptions.json.gz
Beta Was this translation helpful? Give feedback.
All reactions