【问题标题】:Error during document enrichment. Details: "The language of the document could not be identified."文档扩充期间出错。详细信息:“无法识别文档的语言。”
【发布时间】:2018-01-31 16:11:29
【问题描述】:

我正在尝试为 Discovery 上的文档编制索引,但其中一个文档导致了此错误:

Error during document enrichment. Details: "The language of the document could not be identified."

这是我要转换的文本:

Ao tentar emitir uma nota fiscal eletrônica o sistema apresenta a seguinte mensagem: Informar email no cadastro de clientes.
Acessar o cadastro do cliente no qual está emitindo a nota fiscal eletrônica, na aba Complementares e informar o e-mail do cliente no campo E-Mail.

这是我的索引功能:

function indexDocument(doc) {
    return new Promise((resolve, reject) => {
        discovery.addDocument({         
            environment_id: config.watson.environment_id,
            collection_id: config.watson.collection_id,
            file: {
                value: JSON.stringify(doc),
                options: {
                    filename: 'ocorrencia_' + doc.ocorrencia_id + '.json',
                    contentType: 'application/json; charset=utf-8'
                }
            }
        }, (error, data) => {
            if (error) {
                reject(error);
            } else {
                resolve(data);
            }
        });
    });
}

有人知道为什么会出现这个问题吗?有没有办法在 Discovery 上索引文档时直接指定语言?

【问题讨论】:

    标签: node.js watson watson-discovery


    【解决方案1】:

    Discovery 对语言的处理在 2017 年年中得到了增强。我最好的猜测是您使用的 version_date 字符串的某个日期早于 2017 年年中。您可以尝试使用2017-11-07 中最新的version_date 吗?与较早的version_date Discovery 尝试自动检测语言,这有几个缺陷。对于更新的version_date 值,每个集合上指定的语言将用作扩充的指定语言。

    【讨论】:

    • 具体来说,您希望使用2017-06-25 或更高版本的日期。稍后会更好,因为您将获得 API 的更新(包含更多修复)版本。
    猜你喜欢
    • 2013-03-16
    • 2014-03-01
    • 1970-01-01
    • 2011-07-28
    • 1970-01-01
    • 1970-01-01
    • 2022-01-17
    • 2010-09-30
    • 1970-01-01
    相关资源
    最近更新 更多