MCPcopy Create free account
hub / github.com/chengsen/PyTorch_TextGCN / get_train_test

Function get_train_test

trainer.py:28–38  ·  view source on GitHub ↗
(target_fn)

Source from the content-addressed store, hash-verified

26
27
28def get_train_test(target_fn):
29 train_lst = list()
30 test_lst = list()
31 with read_file(target_fn, mode="r") as fin:
32 for indx, item in enumerate(fin):
33 if item.split("\t")[1] in {"train", "training", "20news-bydate-train"}:
34 train_lst.append(indx)
35 else:
36 test_lst.append(indx)
37
38 return train_lst, test_lst
39
40
41class PrepareData:

Callers 1

__init__Method · 0.85

Calls 1

read_fileFunction · 0.90

Tested by

no test coverage detected