c81fafd9c93e90babeab6b0c7321ee88163955ab,ner_v1/chatbot/entity_detection.py,,output_entity_dict_list,#Any#Any#Any#Any#,768

Before Change


        detection_method_list = []

    entity_list = []
    count = 0
    if entity_value_list:
        while count < len(entity_value_list):
            if type(entity_value_list[count]) in [str, unicode]:
                entity_value_list[count] = {
                    ENTITY_VALUE_DICT_KEY: entity_value_list[count]
                }
            if detection_method_list:
                entity_list.append(
                    {
                        ENTITY_VALUE: entity_value_list[count],
                        DETECTION_METHOD: detection_method_list[count],
                        ORIGINAL_TEXT: original_text_list[count]
                    }
                )
            else:
                entity_list.append(
                    {
                        ENTITY_VALUE: entity_value_list[count],
                        DETECTION_METHOD: detection_method,
                        ORIGINAL_TEXT: original_text_list[count]
                    }
                )

            count += 1

    return entity_list


def output_entity_dict_value(entity_value=None, original_text=None, detection_method=None):

After Change


        detection_method_list = []

    entity_list = []
    for i, entity_value in enumerate(entity_value_list):
        if type(entity_value) in [str, unicode]:
            entity_value = {
                ENTITY_VALUE_DICT_KEY: entity_value
            }
        method = detection_method[i] if detection_method_list else detection_method
        entity_list.append(
            {
                ENTITY_VALUE: entity_value,
                DETECTION_METHOD: method,
                ORIGINAL_TEXT: original_text_list[i]
            }
        )

    return entity_list
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: hellohaptik/chatbot_ner
Commit Name: c81fafd9c93e90babeab6b0c7321ee88163955ab
Time: 2018-04-18
Author: jain.chirag925@gmail.com
File Name: ner_v1/chatbot/entity_detection.py
Class Name:
Method Name: output_entity_dict_list


Project Name: hellohaptik/chatbot_ner
Commit Name: 8ddf7bf7b977640e61bb6113186f165748f214a8
Time: 2017-11-07
Author: jain.chirag925@gmail.com
File Name: lib/nlp/regex.py
Class Name: Regex
Method Name: text_substitute


Project Name: google/deepvariant
Commit Name: 13a85e08e713f374933bc4fc082f67e1fa8dcd02
Time: 2018-02-20
Author: cym@google.com
File Name: deepvariant/util/io_utils.py
Class Name:
Method Name: read_shard_sorted_tfrecords