from collections import defaultdict, Counter
import re


def clean_ne(text, nlp):
    """Extract set of clean named entities and Counter from document."""

    symbol_reg = r'[|,\/,(,),/\n,/:]'
    entities = defaultdict()
    doc = nlp(text)

    for ent in doc.ents:
        if ent.label_ not in ['DATE', 'PERCENT', 'CARDINAL']:
            ne = str(ent)
            ne_list = (ne.replace('\n', ',')
                         .replace('/', ',')
                         .replace(':', ',')
                         .replace('(', ',')
                         .replace(')', '')
                         .split(','))
            for ent in ne_list:
                entity = re.sub(symbol_reg, ' ', ent)
                strip = str(entity.lower().strip())
                if len(strip) > 1:
                    entities[strip] = entities.get(strip, 0) + 1
    return entities, Counter(entities).most_common()