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

Non-data size: 4

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: YerevaNN/mimic3-benchmarks
Commit Name: 400c7f81383ceca94a509a047bcbcd66a519516c
Time: 2018-01-23
Author: harhro@gmail.com
File Name: scripts/validate_events.py
Class Name:
Method Name: is_subject_folder


Project Name: Logan1x/Python-Scripts
Commit Name: 2ef5c047b4296a807eea8366f67d7f271f0d47de
Time: 2020-06-28
Author: 59202862+Monsieurvishal@users.noreply.github.com
File Name: bin/password-strength-checker.py
Class Name:
Method Name: pass1