【问题标题】:Is there a dictionary for labels in keras.reuters.datasets?keras.reuters.datasets 中是否有标签字典?
【发布时间】:2019-06-14 16:23:32
【问题描述】:

我最近开始使用 keras 编写神经网络。我设法让 AI 运行,预测路透社新闻专线数据集的类别。但是,我正在拼命寻找一种将我的预测(整数)转换为主题的方法。必须有一个字典——比如训练数据的 reuters.get_word_index——有 46 个条目并将每个整数链接到它的主题(字符串)。感谢您的帮助。

【问题讨论】:

标签: python tensorflow keras reuters


【解决方案1】:

不幸的是,Keras 数据集似乎缺少有关主题的信息。您可以使用同一数据集的 nltk 版本。您也可以在那里获得主题名称。 详情请参阅https://martin-thoma.com/nlp-reuters/

【讨论】:

    【解决方案2】:
    ['cocoa','grain','veg-oil','earn','acq','wheat','copper','housing','money-supply',
    'coffee','sugar','trade','reserves','ship','cotton','carcass','crude','nat-gas',
    'cpi','money-fx','interest','gnp','meal-feed','alum','oilseed','gold','tin',
    'strategic-metal','livestock','retail','ipi','iron-steel','rubber','heat','jobs',
    'lei','bop','zinc','orange','pet-chem','dlr','gas','silver','wpi','hog','lead']
    

    好像是here看到的标签

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-21
      • 2011-12-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-18
      • 1970-01-01
      • 2011-04-07
      相关资源
      最近更新 更多