def extract_topn_from_vector(feature_names, sorted_items, topn=10):
    """get the feature names and tf-idf score of top n items"""
    top_items = sorted_items[:topn] if topn > 0 else sorted_items
    return {feature_names[idx]: sc for idx, sc in top_items}