基于此 guithub 链接https://github.com/brightmart/text_classification,我想运行“ fasttext ”分类,但有些文件我找不到它们,所以我想在其上添加我的自定义数据集作为输入然后运行它。在 github 手册中没有添加我们自己的数据集作为输入的说明?
我该如何解决这个问题?
基于此 guithub 链接https://github.com/brightmart/text_classification,我想运行“ fasttext ”分类,但有些文件我找不到它们,所以我想在其上添加我的自定义数据集作为输入然后运行它。在 github 手册中没有添加我们自己的数据集作为输入的说明?
我该如何解决这个问题?
你不需要 load_file 代码,在这个片段中,他告诉你数据/批次是什么样的,我想为你翻译成英文:
print("testX.shape:", np.array(testX).shape) # 2500 lists, with each list representing a sentence
# there are 2500 lists in testX each one standing for a sentence,
# which means testX is a 2 dimensional list containing 2500 lists
# and each list has several ids of words
print("testY.shape:", np.array(testY).shape) # 2500 labels
# correspondingly there are 2500 labels in the testY which is a
# one dimensional list
print("testX[0]:", testX[0]) # [17, 25, 10, 406, 26, 14, 56, 61, 62, 323, 4]
# this is what the first sentence in testX like (all ids)
print("testX[1]:", testX[1]);
print("testY[0]:", testY[0]) # 0 ;print("testY[1]:",testY[1]) #0
您可以制作自己的 testX 和 testY,它们都只是列表。