您好!在CSDN中看到了您有关“pytorch文本序列化的方法”的帖子,因为我没有什么基础所以有些看不明白的地方。
就是最后“保存 word_sequence ”那一段:
if name == 'main':
a = name
ws = Word2Sequence()
path = "./data/train"
temp_data_path = [os.path.join(path, "pos"), os.path.join(path, "neg")]
for data_path in temp_data_path:
file_paths = [os.path.join(data_path, file_name) for file_name in os.listdir(data_path)]
for file_path in tqdm(file_paths):
sentence = tokenize(open(file_path).read())
ws.fit(sentence)
想请问这里面第四行的“path”、第五行的“ temp_data_path”以及第七行的“ file_paths ”分别指什么路径呀?
如有打扰,深感抱歉!