(self, instruction)
return self.models["named_entity_recognition"]
function to identify name entities
    :param instruction: Used to get target column
    :return: dictionary object with detected name-entities
function to identify name entities
    :param instruction: Used to get target column
    :return: dictionary object with detected name-entities
function to identify name entities : param instruction : Used to get target column : return : dictionary object with detected name - entities
def get_ner(self, instruction):
    """
    function to identify name entities
    :param instruction: Used to get target column
    :return: dictionary object with detected name-entities
    """
    data = DataReader(self.dataset)
    data = data.data_generator()

    target = get_similar_column(get_value_instruction(instruction), data)
    logger("->", "Target Column Found: {}".format(target))

    # Remove stopwords if any from the detection column
    data['combined_text_for_ner'] = data[target].apply(
        lambda x: ' '.join([word for word in x.split() if word not in stopwords.words()]))

    logger("Detecting Name Entities from : {} data files".format(data.shape[0] + 1))

    # Named entity recognition pipeline, default model selection
    with NoStdStreams():
        hugging_face_ner_detector = pipeline('ner', grouped_entities=True, framework='tf')
        data['ner'] = data['combined_text_for_ner'].apply(lambda x: hugging_face_ner_detector(x))
    logger("NER detection status complete")
    logger("Storing information in client object under key 'named_entity_recognition'")

    self.models["named_entity_recognition"] = {
        "model": hugging_face_ner_detector.model,
        "tokenizer": hugging_face_ner_detector.tokenizer,
        'name_entities': data['ner'].to_dict()}

    logger("Output: ", data['ner'].to_dict())
    clearLog()
    return self.models["named_entity_recognition"]
def get_ner ( self , instruction ) : data = DataReader ( self . dataset ) data = data . data_generator ( ) target = get_similar_column ( get_value_instruction ( instruction ) , data ) logger ( "->" , "Target Column Found: {}" . format ( target ) ) # Remove stopwords if any from the detection column data [ 'combined_text_for_ner' ] = data [ target ] . apply ( lambda x : ' ' . join ( [ word for word in x . split ( ) if word not in stopwords . words ( ) ] ) ) logger ( "Detecting Name Entities from : {} data files" . format ( data . shape [ 0 ] + 1 ) ) # Named entity recognition pipeline, default model selection with NoStdStreams ( ) : hugging_face_ner_detector = pipeline ( 'ner' , grouped_entities = True , framework = 'tf' ) data [ 'ner' ] = data [ 'combined_text_for_ner' ] . apply ( lambda x : hugging_face_ner_detector ( x ) ) logger ( "NER detection status complete" ) logger ( "Storing information in client object under key 'named_entity_recognition'" ) self . models [ "named_entity_recognition" ] = { "model" : hugging_face_ner_detector . model , "tokenizer" : hugging_face_ner_detector . tokenizer , 'name_entities' : data [ 'ner' ] . to_dict ( ) } logger ( "Output: " , data [ 'ner' ] . to_dict ( ) ) clearLog ( ) return self . models [ "named_entity_recognition" ]