MCPcopy Index your code
hub / github.com/Turing-Project/WriteGPT / revers_index

Function revers_index

LanguageNetwork/BERT/utils/format_data.py:74–85  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

72
73
74def revers_index(path):
75 data = load_txt_data(path)
76 res = []
77 for item in data:
78 raw = item.split(',')
79 doc = raw[0]
80 try:
81 abst = raw[1]
82 except IndexError:
83 continue
84 res.append('{},{}'.format(abst, doc))
85 save_txt_file(res, path)
86
87
88def filter_data(path):

Callers

nothing calls this directly

Calls 2

load_txt_dataFunction · 0.90
save_txt_fileFunction · 0.90

Tested by

no test coverage detected