文档扩充期间出错。详细信息:"The language of the document could not be identified."



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

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对语言的处理在2017年中期得到了增强。我最好的猜测是您使用的某个日期早于 2017 年中期的version_date字符串。您可以尝试使用2017-11-07的最新version_date吗?在较早的version_date发现中,发现会尝试自动检测该语言,该语言存在多个缺陷。对于最近的version_date值,每个集合上指定的语言将用作扩充的分配语言。

相关内容

最新更新