9f2c085d688ebc0e26f00a3ddd5d7b301ce2ff0f,pytext/utils/data.py,,unkify,#Any#,244

Before Change




def unkify(token):  // noqa: C901
    if any(char.isdigit() for char in token.rstrip()):
        return VocabMeta.UNK_NUM_TOKEN

    return VocabMeta.UNK_TOKEN

After Change



@torch.jit.script
def unkify(token: str):
    res = "<unk>"
    for idx in range(len(token)):
        if token[idx].isdigit():
            res = "<unk>-NUM"

    return res
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: facebookresearch/pytext
Commit Name: 9f2c085d688ebc0e26f00a3ddd5d7b301ce2ff0f
Time: 2019-06-05
Author: zsc@fb.com
File Name: pytext/utils/data.py
Class Name:
Method Name: unkify


Project Name: explosion/thinc
Commit Name: d8c628840b502e8cd950f2030a1c7bcbd61595e7
Time: 2020-01-08
Author: ines@ines.io
File Name: thinc/config.py
Class Name: registry
Method Name: parse_args


Project Name: etal/cnvkit
Commit Name: 969c31e8e32bedbaa65f82222cff07e068553bc3
Time: 2015-07-06
Author: eric.talevich@gmail.com
File Name: cnvlib/core.py
Class Name:
Method Name: sorter_chrom