Esempio n. 1
0
def load_states_from_file(f):
    """
    Load a stream of states from a file.
    """
    return (State.from_json(json.loads(line)) for line in tqdm(list(f)))
Esempio n. 2
0
def test_data():
    """
    Load some data for the embedder.
    """
    with open("tests/data/snli_100.jsonl") as f:
        return [State.from_json(json.loads(line)) for line in f]