【问题标题】:add custom dataset into fasttext classification deep learning将自定义数据集添加到 fasttext 分类深度学习中
【发布时间】:2017-11-28 10:00:31
【问题描述】:

基于此 guithub 链接 https://github.com/brightmart/text_classification,我想运行“fasttext”分类,但有些文件我找不到它们,所以 我想添加我的自定义数据集作为输入,然后运行它。 在 github 手册中没有说明添加我们自己的数据集作为输入?

我该如何解决这个问题?

【问题讨论】:

    标签: tensorflow deep-learning text-classification fasttext


    【解决方案1】:

    你不需要load_file代码,this snippet他已经告诉你数据/批次是什么样的,我想为你翻译成英文:

    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,它们都只是列表。

    【讨论】:

      猜你喜欢
      • 2020-05-01
      • 2016-10-24
      • 2018-03-29
      • 2021-02-28
      • 2020-04-01
      • 2018-03-25
      • 2018-08-04
      • 2018-09-17
      • 2021-06-17
      相关资源
      最近更新 更多