(entity_tokens)
return lemmas
Lemmatize the list of tokens using the Stanford CoreNLP.

    :param entity_tokens:
    :return:
    >>> _lemmatize_tokens(['House', 'Of', 'Representatives'])
    ['House', 'Of', 'Representative']
    >>> _lemmatize_tokens(['Canadians'])
    ['Canadian']
    >>> _lemmatize_tokens(['star', 'wars'])
    ['star', 'war']
    >>> _lemmatize_tokens(['Movie', 'does'])
    ['Movie', 'do']
    >>> _lemmatize_tokens("who is the member of the house of representatives?".split())
    ['who', 'be', 'the', 'member', 'of', 'the', 'house', 'of', 'representative', '?']
Lemmatize the list of tokens using the Stanford CoreNLP.
Lemmatize the list of tokens using the Stanford CoreNLP .
def _lemmatize_tokens(entity_tokens):
    """
    Lemmatize the list of tokens using the Stanford CoreNLP.

    :param entity_tokens:
    :return:
    >>> _lemmatize_tokens(['House', 'Of', 'Representatives'])
    ['House', 'Of', 'Representative']
    >>> _lemmatize_tokens(['Canadians'])
    ['Canadian']
    >>> _lemmatize_tokens(['star', 'wars'])
    ['star', 'war']
    >>> _lemmatize_tokens(['Movie', 'does'])
    ['Movie', 'do']
    >>> _lemmatize_tokens("who is the member of the house of representatives?".split())
    ['who', 'be', 'the', 'member', 'of', 'the', 'house', 'of', 'representative', '?']
    """
    try:
        lemmas = corenlp.annotate(" ".join([t.lower() for t in entity_tokens]), properties={
            'annotators': 'tokenize, lemma',
            'outputFormat': 'json'
        }).get("sentences", [])[0]['tokens']
    except:
        lemmas = []
    lemmas = [t['lemma'] for t in lemmas]
    lemmas = [l.title() if i < len(entity_tokens) and entity_tokens[i].istitle() else l for i, l in enumerate(lemmas)]
    return lemmas
def _lemmatize_tokens ( entity_tokens ) : try : lemmas = corenlp . annotate ( " " . join ( [ t . lower ( ) for t in entity_tokens ] ) , properties = { 'annotators' : 'tokenize, lemma' , 'outputFormat' : 'json' } ) . get ( "sentences" , [ ] ) [ 0 ] [ 'tokens' ] except : lemmas = [ ] lemmas = [ t [ 'lemma' ] for t in lemmas ] lemmas = [ l . title ( ) if i < len ( entity_tokens ) and entity_tokens [ i ] . istitle ( ) else l for i , l in enumerate ( lemmas ) ] return lemmas