Пример #1
0
def show_word_cluster_result():
    word_df = news_pandas.load_news(os.path.join(results_path, 'word_df.csv'))
    word_df['wordvec'] = word_df['wordvec'].map(eval)
    wordvec_list = word_df['wordvec'].tolist()
    word_label = word_df['word_label'].tolist()
    word_pca_tsne = modeling.feature_reduction(wordvec_list, pca_n_components=3, tsne_n_components=2)
    drawing.draw_clustering_result(word_pca_tsne, word_label)
Пример #2
0
def show_cluster_result():
    try:
        df_non_outliers = news_pandas.load_news(os.path.join(results_path, 'news_non_outliers.csv'))
        df_non_outliers['pca_tsne'] = df_non_outliers['pca_tsne'].map(eval)
    except FileNotFoundError:
        messagebox.showinfo('Message', '请先对新闻内容文本进行聚类!')
        return
    drawing.draw_clustering_result(df_non_outliers['pca_tsne'], df_non_outliers['label'])