小编Cel*_*nça的帖子

SQuAD 挑战中的 EM 分数

小队挑战排名对F1和EM得分结果。有很多关于 F1 分数的信息(精确率和召回率的函数)。但是 EM 分数是多少?

machine-learning reinforcement-learning stanford-nlp deep-learning tensorflow

13
推荐指数
1
解决办法
5019
查看次数

Electron 中的 TypeScript 支持

Electron 现在支持打字稿。但是通过运行在以下位置发布的示例:

电子官方博客

我总是收到以下错误:

在此处输入图片说明

我应该做点别的吗?

typescript electron

5
推荐指数
1
解决办法
849
查看次数

如何从 tf.py_function 返回张量字典?

通常,变压器分词器将输入编码为字典。

{"input_ids": tf.int32, "attention_mask": tf.int32, "token_type_ids": tf.int32}
Run Code Online (Sandbox Code Playgroud)

为了对大型数据集进行更好的性能处理,最好实现一个管道,其中包括将Dataset.map分词器函数应用于输入数据集的每个元素。与 Tensorflow 教程中所做的完全相同:加载文本

但是,tf.py_function(用于包装 map python 函数)不支持返回张量字典,如上所示。

例如,如果加载文本中的分词器(编码器)返回以下字典:

{
    "input_ids": [ 101, 13366,  2131,  1035,  6819,  2094,  1035,  102 ],
    "attention_mask": [ 1, 1, 1, 1, 1, 1, 1, 1 ]
}
Run Code Online (Sandbox Code Playgroud)

如何设置 的Tout参数tf.py_function来获取所需的张量字典:

{
    'input_ids': <tf.Tensor: shape=(16,), dtype=int32, numpy = array(
    [ 101, 13366,  2131,  1035,  6819,  2094,  1035,  102 ], dtype=int32)>

    'attention_mask': <tf.Tensor: shape=(16,), dtype=int32, numpy=array(
     [ 1, 1, …
Run Code Online (Sandbox Code Playgroud)

python-3.x tensorflow2.0 huggingface-transformers

4
推荐指数
1
解决办法
2871
查看次数