(filename)
return documents
Parse the contents of a file. Each line is a JSON encoded document.
Parse the contents of a file. Each line is a JSON encoded document.
Parse the contents of a file . Each line is a JSON encoded document .
def get_contents_hotpotqa(filename):
    """Parse the contents of a file. Each line is a JSON encoded document."""
    global PREPROCESS_FN
    documents = []
    extracted_items = process_jsonlines_hotpotqa(filename)
    for extracted_item in extracted_items:
        title = extracted_item["title"]
        text = extracted_item["plain_text"]
        original_title = extracted_item["original_title"]
        hyper_linked_titles = extracted_item["hyper_linked_titles"]

        documents.append((title, text,
                          hyper_linked_titles, original_title))
    return documents
def get_contents_hotpotqa ( filename ) : global PREPROCESS_FN documents = [ ] extracted_items = process_jsonlines_hotpotqa ( filename ) for extracted_item in extracted_items : title = extracted_item [ "title" ] text = extracted_item [ "plain_text" ] original_title = extracted_item [ "original_title" ] hyper_linked_titles = extracted_item [ "hyper_linked_titles" ] documents . append ( ( title , text , hyper_linked_titles , original_title ) ) return documents