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


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: 4

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: cesium-ml/cesium
Commit Name: 384e8e0f8a91815568aa3d4c651c8c5e48979262
Time: 2015-12-17
Author: a.crellinquick@gmail.com
File Name: mltsp/util.py
Class Name:
Method Name: cast_model_params


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


Project Name: tensorflow/cleverhans
Commit Name: 44356a0991665dd9cd1fc3d95a39dd13ab4384ad
Time: 2017-09-27
Author: fartash@google.com
File Name: examples/multigpu_advtrain/evaluator.py
Class Name: Evaluator
Method Name: eval_multi