e3931c33e2e5f4b148a918d798cc27224ed090b7,examples/bert/utils/tokenization.py,,convert_to_unicode,#Any#,29

Before Change


    
    if six.PY3:
        if isinstance(text, str):
            return text
        elif isinstance(text, bytes):
            return text.decode("utf-8", "ignore")
        else:
            raise ValueError("Unsupported string type: %s" % (type(text)))

After Change



def convert_to_unicode(text):
    Returns the given argument as a unicode string.
    return tf.compat.as_text(text)

def printable_text(text):
    Returns text encoded in a way suitable for print or `tf.logging`.
    return tf.compat.as_str_any(text)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: asyml/texar
Commit Name: e3931c33e2e5f4b148a918d798cc27224ed090b7
Time: 2018-11-29
Author: haoranshi97@gmail.com
File Name: examples/bert/utils/tokenization.py
Class Name:
Method Name: convert_to_unicode


Project Name: OpenNMT/OpenNMT-tf
Commit Name: 5c01f05248e221365811e044fdeaf3aac5c2658e
Time: 2018-07-04
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tokenizers/opennmt_tokenizer.py
Class Name: OpenNMTTokenizer
Method Name: _tokenize_string


Project Name: tensorflow/datasets
Commit Name: 2b33928fb832eacb3fe7684902fc5f05316eca46
Time: 2018-12-06
Author: rsepassi@google.com
File Name: tensorflow_datasets/core/features/class_label_feature.py
Class Name: ClassLabel
Method Name: names