Skip to content

Instantly share code, notes, and snippets.

{'expanded': {1: {0: {'keywords': ['leather_photo_frame',
'leather_picture_frame',
'double_leather_photo_frame',
'double_leather_travel_photo_frame',
'double_photo_frame',
'leather_crocodile_print_leather_double_photo_frame',
'leather_crocodile_print_leather_triple_photo_frame',
'leather_double_photo_frame',
'leather_double_photograph_frame',
'leather_double_picture_frame',
{'hampton': {1: {0: {'keywords': ['leather_card_case',
'leather_business_card_case',
'leather_business_card_book',
'card_case_leather',
'leather_business_card_books',
'travel_card_case_leather',
'leather_business_card_file',
'business_card_file_leather',
'leather_travel_card_case',
'luxury_business_card_case',
Disposable gloves
{1: {0: ['best_quality_disposable_gloves',
'colored_disposable_gloves',
'extra_long_disposable_gloves',
'food_service_disposable_gloves',
'industrial_disposable_gloves',
'wholesale_disposable_gloves',
'black_disposable_gloves',
'disposable_food_service_gloves',
epsilons = [10, 12, 14, 17, 20]
min_samples = [5, 10, 15, 20]
data = {
'sun_trust': ["best_Forest_Highland_Mobile_AL_auto", "Coral_Springs_FL_banks", "banker_branch_mortgage_net", "Baltimore_MD_Grove_Park_cash_advance", "bank_in_Downtown_Tampa_FL", "Sugar_Land_harp_lender", "top_bank_33020", "top_bank_in_Leesburg_Virginia", "accounting_Kensington_San_Diego", "chase_bank_charleston_sc", "car_insurance_Sterling_Charlotte_North_Carolina", "top_Midtown_Atlanta_banks", "bank_in_Pleasant_Valley_Austin", "bank_in_Casselberry_FL", "bank_Old_Town_Area_Baltimore_MD", "best_car_insurance_Huntersville_NC", "top_bank_Deerfield_Beach_FL", "top_bank_Pinecrest_Florida", "best_in_Raleigh_Memphis_amc", "bank_in_Virginia_Petersburg", "chevy_in_New_Village_Phoenix", "Hampton_VA_Downtown_bank", "Old_North_Knoxville_Knoxville_TN_bank", "top_bank_in_Leesburg_VA", "top_bank_in_Hampton_VA", "North_Central_Raleigh_NC_accounting", "sun_bank_florida", "bank_account_Jacksonville_FL", "Annapolis_Mary._accounting", "best_bank_Cocoa_Flori
epsilons = [10, 12, 14, 17, 20]
min_samples = [5, 10, 15, 20]
data = {
'sun_trust': ["best_Forest_Highland_Mobile_AL_auto", "Coral_Springs_FL_banks", "banker_branch_mortgage_net", "Baltimore_MD_Grove_Park_cash_advance", "bank_in_Downtown_Tampa_FL", "Sugar_Land_harp_lender", "top_bank_33020", "top_bank_in_Leesburg_Virginia", "accounting_Kensington_San_Diego", "chase_bank_charleston_sc", "car_insurance_Sterling_Charlotte_North_Carolina", "top_Midtown_Atlanta_banks", "bank_in_Pleasant_Valley_Austin", "bank_in_Casselberry_FL", "bank_Old_Town_Area_Baltimore_MD", "best_car_insurance_Huntersville_NC", "top_bank_Deerfield_Beach_FL", "top_bank_Pinecrest_Florida", "best_in_Raleigh_Memphis_amc", "bank_in_Virginia_Petersburg", "chevy_in_New_Village_Phoenix", "Hampton_VA_Downtown_bank", "Old_North_Knoxville_Knoxville_TN_bank", "top_bank_in_Leesburg_VA", "top_bank_in_Hampton_VA", "North_Central_Raleigh_NC_accounting", "sun_bank_florida", "bank_account_Jacksonville_FL", "Annapolis_Mary._accounting", "best_bank_Cocoa_Flori
epsilons = [10, 12, 14, 17, 20]
min_samples = [5, 10, 15, 20]
data = {
'sun_trust': ["best_Forest_Highland_Mobile_AL_auto", "Coral_Springs_FL_banks", "banker_branch_mortgage_net", "Baltimore_MD_Grove_Park_cash_advance", "bank_in_Downtown_Tampa_FL", "Sugar_Land_harp_lender", "top_bank_33020", "top_bank_in_Leesburg_Virginia", "accounting_Kensington_San_Diego", "chase_bank_charleston_sc", "car_insurance_Sterling_Charlotte_North_Carolina", "top_Midtown_Atlanta_banks", "bank_in_Pleasant_Valley_Austin", "bank_in_Casselberry_FL", "bank_Old_Town_Area_Baltimore_MD", "best_car_insurance_Huntersville_NC", "top_bank_Deerfield_Beach_FL", "top_bank_Pinecrest_Florida", "best_in_Raleigh_Memphis_amc", "bank_in_Virginia_Petersburg", "chevy_in_New_Village_Phoenix", "Hampton_VA_Downtown_bank", "Old_North_Knoxville_Knoxville_TN_bank", "top_bank_in_Leesburg_VA", "top_bank_in_Hampton_VA", "North_Central_Raleigh_NC_accounting", "sun_bank_florida", "bank_account_Jacksonville_FL", "Annapolis_Mary._accounting", "best_bank_Cocoa_Flori
{1: {0: {'cluster': ['social_media',
'digital_marketing',
'small_business',
'marketing_strategy',
'business_owners',
'local_businesses',
'business_owner',
'small_business_owners',
'social_networks',
'social_media_manager',
Customer prospectives
{1: {1: ['potential_customers',
'prospective_customers',
'future_customers',
'existing_customers',
'current_customers',
'reach_customers',
'gain_new_customers',
'ideal_customers',
Main clusters:
Disposable poly/nitrile/latex gloves
ADJECTIVE gloves
Food/service/automotive industry
Latex/Nitril/vinyl/poly material/rubber
Vinyl/poly gloves
Protection/safety products
Glove + ADJECTIVE/NOUN
Off topic sales jargon terms
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from sklearn.cluster import KMeans
import gensim
import sys
from pprint import pprint
import numpy as np
import collections
from sklearn.cluster import DBSCAN