Starspace:labelDoc fileFormat 的解释是什么?

Starspace: What is the interpretation of the labelDoc fileFormat?

starspace 文档对取值 'labelDoc' 或 'fastText' 的参数 'fileFormat' 不清楚。 我想直观地了解这个参数的设置会有什么实质性的不同。

目前,我最好的猜测是,如果您将 fileFormat 设置为 'fastText',那么训练文件中没有前缀“__label__”的所有标记都将被分解为字符级别与 fastText 一样的 n-gram。 或者,如果您将 fileFormat 设置为 'labelDoc',则 starspace 将假定所有标记实际上都是标签,并且您不需要在标记前添加“__label__”,因为它们无论如何都会被识别为标签。

我的想法正确吗?

StarSpace 使用标签的方式很大程度上取决于您使用的 trainMode。 labelDoc 格式在您使用仅依赖于标签(trainMode 1 到 4)的 trainMode 时很有用,其中使用 fastText[= 可能是同一件事27=] 格式指定 __label__ 前缀,但一些 trainModes 受益于 labelDoc 格式(即 trainMode 1 或 3)以使用整个句子作为该 trainMode 的标签元素。

所以澄清一下,如果您正在执行文本分类任务(如 this example labelDoc 中所述,则不会识别任何输入,但另一方面,正如您所说,使用 fastText 格式会将所有未标记的文本分解为输入并学习预测 __label__ 标签。

labelDoc 格式的一个示例是开发基于内容的推荐系统(如 this example) every tab separated sentence is used at LHS or RHS during training time. But if you go on a collaborative approach (the content of the articles or wherever you sentences come from is not taken in account) it can be trained either with fastText (specifying the __label__ prefix) or labelDoc file format as labels are picked randomly during training time for LHS or RHS. (This second example is explained here 中所述)。