{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Visualizing Topic clusters\n",
"\n",
"In this notebook, we will learn how to visualize topic clusters using dendrogram. Dendrogram is a tree-structured graph which can be used to visualize the result of a hierarchical clustering calculation. Hierarchical clustering puts individual data points into similarity groups, without prior knowledge of groups. We can use it to explore the topic models and see how the topics are connected to each other in a sequence of successive fusions or divisions that occur in the clustering process."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip install plotly>=2.0.16 # 2.0.16 need for support 'hovertext' argument from create_dendrogram function"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/vnd.plotly.v1+html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from gensim.models.ldamodel import LdaModel\n",
"from gensim.corpora import Dictionary\n",
"from gensim.parsing.preprocessing import remove_stopwords, strip_punctuation\n",
"\n",
"import numpy as np\n",
"import pandas as pd\n",
"import re\n",
"\n",
"import plotly.offline as py\n",
"import plotly.graph_objs as go\n",
"import plotly.figure_factory as ff\n",
"\n",
"py.init_notebook_mode()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Train Model\n",
"\n",
"We'll use the [fake news dataset](https://www.kaggle.com/mrisdal/fake-news) from kaggle for this notebook. First step is to preprocess the data and train our topic model using LDA. You can refer to this [notebook](https://github.com/RaRe-Technologies/gensim/blob/develop/docs/notebooks/lda_training_tips.ipynb) also for tips and suggestions of pre-processing the text data, and how to train LDA model for getting good results."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"df_fake = pd.read_csv('fake.csv')\n",
"df_fake[['title', 'text', 'language']].head()\n",
"df_fake = df_fake.loc[(pd.notnull(df_fake.text)) & (df_fake.language == 'english')]\n",
"\n",
"# remove stopwords and punctuations\n",
"def preprocess(row):\n",
" return strip_punctuation(remove_stopwords(row.lower()))\n",
" \n",
"df_fake['text'] = df_fake['text'].apply(preprocess)\n",
"\n",
"# Convert data to required input format by LDA\n",
"texts = []\n",
"for line in df_fake.text:\n",
" lowered = line.lower()\n",
" words = re.findall(r'\\w+', lowered, flags=re.UNICODE|re.LOCALE)\n",
" texts.append(words)\n",
"# Create a dictionary representation of the documents.\n",
"dictionary = Dictionary(texts)\n",
"\n",
"# Filter out words that occur less than 2 documents, or more than 30% of the documents.\n",
"dictionary.filter_extremes(no_below=2, no_above=0.4)\n",
"# Bag-of-words representation of the documents.\n",
"corpus_fake = [dictionary.doc2bow(text) for text in texts]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"lda_fake = LdaModel(corpus=corpus_fake, id2word=dictionary, num_topics=35, passes=30, chunksize=1500, iterations=200, alpha='auto')\n",
"lda_fake.save('lda_35')"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"lda_fake = LdaModel.load('lda_35')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Basic Dendrogram\n",
"\n",
"Firstly, a distance matrix is calculated to store distance between every topic pair. These distances are then used ascendingly to cluster the topics together whose process is depicted by the dendrogram."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"from gensim.matutils import jensen_shannon\n",
"from scipy import spatial as scs\n",
"from scipy.cluster import hierarchy as sch\n",
"from scipy.spatial.distance import pdist, squareform\n",
"\n",
"\n",
"# get topic distributions\n",
"topic_dist = lda_fake.state.get_lambda()\n",
"\n",
"# get topic terms\n",
"num_words = 300\n",
"topic_terms = [{w for (w, _) in lda_fake.show_topic(topic, topn=num_words)} for topic in range(topic_dist.shape[0])]\n",
"\n",
"# no. of terms to display in annotation\n",
"n_ann_terms = 10\n",
"\n",
"# use Jensen-Shannon distance metric in dendrogram\n",
"def js_dist(X):\n",
" return pdist(X, lambda u, v: jensen_shannon(u, v))\n",
"\n",
"# define method for distance calculation in clusters\n",
"linkagefun=lambda x: sch.linkage(x, 'single')\n",
"\n",
"# calculate text annotations\n",
"def text_annotation(topic_dist, topic_terms, n_ann_terms, linkagefun):\n",
" # get dendrogram hierarchy data\n",
" linkagefun = lambda x: sch.linkage(x, 'single')\n",
" d = js_dist(topic_dist)\n",
" Z = linkagefun(d)\n",
" P = sch.dendrogram(Z, orientation=\"bottom\", no_plot=True)\n",
"\n",
" # store topic no.(leaves) corresponding to the x-ticks in dendrogram\n",
" x_ticks = np.arange(5, len(P['leaves']) * 10 + 5, 10)\n",
" x_topic = dict(zip(P['leaves'], x_ticks))\n",
"\n",
" # store {topic no.:topic terms}\n",
" topic_vals = dict()\n",
" for key, val in x_topic.items():\n",
" topic_vals[val] = (topic_terms[key], topic_terms[key])\n",
"\n",
" text_annotations = []\n",
" # loop through every trace (scatter plot) in dendrogram\n",
" for trace in P['icoord']:\n",
" fst_topic = topic_vals[trace[0]]\n",
" scnd_topic = topic_vals[trace[2]]\n",
" \n",
" # annotation for two ends of current trace\n",
" pos_tokens_t1 = list(fst_topic[0])[:min(len(fst_topic[0]), n_ann_terms)]\n",
" neg_tokens_t1 = list(fst_topic[1])[:min(len(fst_topic[1]), n_ann_terms)]\n",
"\n",
" pos_tokens_t4 = list(scnd_topic[0])[:min(len(scnd_topic[0]), n_ann_terms)]\n",
" neg_tokens_t4 = list(scnd_topic[1])[:min(len(scnd_topic[1]), n_ann_terms)]\n",
"\n",
" t1 = \"
\".join((\": \".join((\"+++\", str(pos_tokens_t1))), \": \".join((\"---\", str(neg_tokens_t1)))))\n",
" t2 = t3 = ()\n",
" t4 = \"
\".join((\": \".join((\"+++\", str(pos_tokens_t4))), \": \".join((\"---\", str(neg_tokens_t4)))))\n",
"\n",
" # show topic terms in leaves\n",
" if trace[0] in x_ticks:\n",
" t1 = str(list(topic_vals[trace[0]][0])[:n_ann_terms])\n",
" if trace[2] in x_ticks:\n",
" t4 = str(list(topic_vals[trace[2]][0])[:n_ann_terms])\n",
"\n",
" text_annotations.append([t1, t2, t3, t4])\n",
"\n",
" # calculate intersecting/diff for upper level\n",
" intersecting = fst_topic[0] & scnd_topic[0]\n",
" different = fst_topic[0].symmetric_difference(scnd_topic[0])\n",
"\n",
" center = (trace[0] + trace[2]) / 2\n",
" topic_vals[center] = (intersecting, different)\n",
"\n",
" # remove trace value after it is annotated\n",
" topic_vals.pop(trace[0], None)\n",
" topic_vals.pop(trace[2], None) \n",
" \n",
" return text_annotations"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"data": [
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'coup', u'peace', u'shot', u'citizenry', u'maduro', u'teams', u'actions', u'cross', u'seen', u'unrest']",
[],
[],
"[u'monte', u'sprayed', u'shot', u'they', u'corps', u'september', u'sound', u'jurisdiction', u'resistance', u'sites']"
],
"type": "scatter",
"x": [
85,
85,
95,
95
],
"xaxis": "x",
"y": [
0,
0.5239915229525761,
0.5239915229525761,
0
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'atmosphere', u'stores', u'help', u'caused', u'magnetic', u'major', u'produce', u'years', u'product', u'baby']",
[],
[],
"[u'all', u'influenza', u'help', u'cdc', u'biological', u'caused', u'child', u'results', u'dose', u'brain']"
],
"type": "scatter",
"x": [
145,
145,
155,
155
],
"xaxis": "x",
"y": [
0,
0.4952833500135926,
0.4952833500135926,
0
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'passed', u'rifles', u'tactics', u'office', u'violation', u'issued', u'obtain', u'actions', u'years', u'sources']",
[],
[],
"[u'affair', u'thomas', u'responsible', u'shot', u'office', u'sentence', u'september', u'issued', u'agreed', u'child']"
],
"type": "scatter",
"x": [
205,
205,
215,
215
],
"xaxis": "x",
"y": [
0,
0.4842267300317968,
0.4842267300317968,
0
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(61,153,112)"
},
"mode": "lines",
"text": [
"[u'rating', u'office', u'photo', u'over', u'despite', u'results', u'years', u'course', u'protest', u'radio']",
[],
[],
"[u'saying', u'decide', u'predicted', u'fox', u'results', u'night', u'including', u'democrats', u'committee', u'mcmullin']"
],
"type": "scatter",
"x": [
245,
245,
255,
255
],
"xaxis": "x",
"y": [
0,
0.4091655719588642,
0.4091655719588642,
0
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(61,153,112)"
},
"mode": "lines",
"text": [
"[u'saying', u'breaking', u'office', u'watergate', u'mishandling', u'laptop', u'probe', u'actions', u'discovered', u'sources']",
[],
[],
"+++: [u'results', u'paul', u'supporter', u'candidate', u'actually', u'barack', u'going', u'8', u'far', u'possible']
---: [u'saying', u'rating', u'month', u'unrest', u'protest', u'radio', u'democrats', u'mcmullin', u'follow', u'battleground']"
],
"type": "scatter",
"x": [
235,
235,
250,
250
],
"xaxis": "x",
"y": [
0,
0.41213545918752137,
0.41213545918752137,
0.4091655719588642
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(255,65,54)"
},
"mode": "lines",
"text": [
"[u'operations', u'called', u'bomb', u'0', u'chinese', u'september', u'photo', u'agreed', u'global', u'spain']",
[],
[],
"[u'coup', u'all', u'sergey', u'bomb', u'saying', u'photo', u'supported', u'repeatedly', u'soon', u'actions']"
],
"type": "scatter",
"x": [
285,
285,
295,
295
],
"xaxis": "x",
"y": [
0,
0.41280889631027384,
0.41280889631027384,
0
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(255,65,54)"
},
"mode": "lines",
"text": [
"[u'operations', u'saying', u'peace', u'rebels', u'ambassador', u'september', u'settlements', u'years', u'held', u'fighters']",
[],
[],
"+++: [u'bomb', u'photo', u'global', u'soon', u'years', u'including', u'cold', u'issues', u'ground', u'based']
---: [u'saying', u'all', u'chinese', u'enemy', u'agreed', u'supported', u'month', u'sergey', u'planning', u'asia']"
],
"type": "scatter",
"x": [
275,
275,
290,
290
],
"xaxis": "x",
"y": [
0,
0.4337091828241252,
0.4337091828241252,
0.41280889631027384
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(35,205,205)"
},
"mode": "lines",
"text": [
"[u'greater', u'limited', u'help', u'lack', u'focus', u'actions', u'naturally', u'bring', u'books', u'higher']",
[],
[],
"[u'called', u'all', u'enemy', u'hands', u'global', u'domestic', u'resistance', u'rest', u'years', u'course']"
],
"type": "scatter",
"x": [
305,
305,
315,
315
],
"xaxis": "x",
"y": [
0,
0.44592943928705275,
0.44592943928705275,
0
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"+++: [u'major', u'force', u'years', u'likely', u'officials', u'anti', u'iran', u'armed', u'ground', u'united']
---: [u'saying', u'bomb', u'rebels', u'ali', u'global', u'tehran', u'qaeda', u'mosul', u'battle', u'soldiers']",
[],
[],
"+++: [u'and', u'control', u'major', u'want', u'point', u'powerful', u'community', u'past', u'society', u'simply']
---: [u'limited', u'all', u'consider', u'global', u'resistance', u'bring', u'emotions', u'follow', u'meditation', u'research']"
],
"type": "scatter",
"x": [
282.5,
282.5,
310,
310
],
"xaxis": "x",
"y": [
0.4337091828241252,
0.46861372445664873,
0.46861372445664873,
0.44592943928705275
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'operations', u'all', u'soros', u'office', u'money', u'meetings', u'executive', u'insider', u'years', u'founded']",
[],
[],
"+++: [u'major', u'us']
---: [u'control', u'point', u'powerful', u'community', u'years', u'course', u'simply', u'human', u'fear', u'armed']"
],
"type": "scatter",
"x": [
265,
265,
296.25,
296.25
],
"xaxis": "x",
"y": [
0,
0.4806143422338316,
0.4806143422338316,
0.46861372445664873
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"+++: [u'says', u'campaign', u'point', u'house', u'in', u'washington', u'likely', u'street', u'election', u'year']
---: [u'saying', u'watergate', u'mishandling', u'probe', u'results', u'discovered', u'obstruction', u'manager', u'democrats', u'aides']",
[],
[],
"+++: []
---: [u'operations', u'all', u'responsible', u'office', u'money', u'meetings', u'executive', u'raised', u'years', u'founded']"
],
"type": "scatter",
"x": [
242.5,
242.5,
280.625,
280.625
],
"xaxis": "x",
"y": [
0.41213545918752137,
0.4847681088638261,
0.4847681088638261,
0.4806143422338316
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'ambassador', u'agency', u'mexican', u'help', u'office', u'diplomacy', u'money', u'executive', u'years', u'2008']",
[],
[],
"+++: []
---: [u'says', u'nominee', u'point', u'house', u'in', u'washington', u'likely', u'street', u'election', u'year']"
],
"type": "scatter",
"x": [
225,
225,
261.5625,
261.5625
],
"xaxis": "x",
"y": [
0,
0.4848588855404342,
0.4848588855404342,
0.4847681088638261
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"+++: [u'and', u'attorney', u'ordered', u'office', u'judge', u'issued', u'national', u'crimes', u'authorities', u'actions']
---: [u'affair', u'thomas', u'shot', u'violation', u'agreed', u'allegations', u'month', u'discovered', u'rifles', u'gang']",
[],
[],
"+++: []
---: [u'ambassador', u'code', u'mexican', u'help', u'office', u'diplomacy', u'money', u'executive', u'years', u'supreme']"
],
"type": "scatter",
"x": [
210,
210,
243.28125,
243.28125
],
"xaxis": "x",
"y": [
0.4842267300317968,
0.49484305255926003,
0.49484305255926003,
0.4848588855404342
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'saying', u'all', u'help', u'money', u'hands', u'soon', u'rest', u'years', u'course', u'looks']",
[],
[],
"+++: []
---: [u'and', u'asked', u'attorney', u'ordered', u'family', u'judge', u'issued', u'national', u'crimes', u'actions']"
],
"type": "scatter",
"x": [
195,
195,
226.640625,
226.640625
],
"xaxis": "x",
"y": [
0,
0.500953938948598,
0.500953938948598,
0.49484305255926003
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'sector', u'bull', u'gold', u'unemployment', u'money', u'global', u'dollar', u'trade', u'paper', u'businesses']",
[],
[],
"+++: []
---: [u'saying', u'all', u'help', u'money', u'able', u'soon', u'rest', u'years', u'course', u'looks']"
],
"type": "scatter",
"x": [
185,
185,
210.8203125,
210.8203125
],
"xaxis": "x",
"y": [
0,
0.5090095510485566,
0.5090095510485566,
0.500953938948598
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'gdp', u'proceeds', u'september', u'42', u'global', u'wednesday', u'results', u'years', u'leads', u'batteries']",
[],
[],
"+++: []
---: [u'sector', u'manufacturing', u'chinese', u'unemployment', u'money', u'global', u'dollar', u'trade', u'paper', u'businesses']"
],
"type": "scatter",
"x": [
175,
175,
197.91015625,
197.91015625
],
"xaxis": "x",
"y": [
0,
0.5114472916005423,
0.5114472916005423,
0.5090095510485566
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'saying', u'neighborhood', u'answering', u'shot', u'help', u'photo', u'celebrities', u'years', u'seen', u'performance']",
[],
[],
"+++: []
---: [u'gdp', u'september', u'percent', u'global', u'43', u'results', u'years', u'leads', u'batteries', u'including']"
],
"type": "scatter",
"x": [
165,
165,
186.455078125,
186.455078125
],
"xaxis": "x",
"y": [
0,
0.5123688748079201,
0.5123688748079201,
0.5114472916005423
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"+++: [u'heavy', u'available', u'associated', u'help', u'cancer', u'caused', u'reduce', u'plant', u'evidence', u'high']
---: [u'wild', u'all', u'influenza', u'sci', u'phenomenon', u'cdc', u'magnetic', u'results', u'produce', u'sleep']",
[],
[],
"+++: []
---: [u'saying', u'breaking', u'shot', u'help', u'photo', u'child', u'celebrities', u'years', u'costume', u'victim']"
],
"type": "scatter",
"x": [
150,
150,
175.7275390625,
175.7275390625
],
"xaxis": "x",
"y": [
0.4952833500135926,
0.527410482799219,
0.527410482799219,
0.5123688748079201
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'stones', u'atmosphere', u'concept', u'evidence', u'consciousness', u'being', u'global', u'souls', u'years', u'held']",
[],
[],
"+++: []
---: [u'heavy', u'body', u'associated', u'help', u'cancer', u'caused', u'reduce', u'product', u'evidence', u'high']"
],
"type": "scatter",
"x": [
135,
135,
162.86376953125,
162.86376953125
],
"xaxis": "x",
"y": [
0,
0.5298682068894442,
0.5298682068894442,
0.527410482799219
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'forced', u'played', u'chinese', u'german', u'2005', u'supported', u'rest', u'years', u'course', u'cambridge']",
[],
[],
"+++: []
---: [u'stones', u'called', u'atmosphere', u'concept', u'pope', u'being', u'global', u'souls', u'years', u'held']"
],
"type": "scatter",
"x": [
125,
125,
148.931884765625,
148.931884765625
],
"xaxis": "x",
"y": [
0,
0.5358130859045249,
0.5358130859045249,
0.5298682068894442
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'jihadist', u'acts', u'particularly', u'cheese', u'money', u'half', u'month', u'sources', u'embassy', u'including']",
[],
[],
"+++: []
---: [u'called', u'chinese', u'german', u'supported', u'rest', u'years', u'course', u'aoun', u'london', u'hungary']"
],
"type": "scatter",
"x": [
115,
115,
136.9659423828125,
136.9659423828125
],
"xaxis": "x",
"y": [
0,
0.5368743566366792,
0.5368743566366792,
0.5358130859045249
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'watergate', u'thomas', u'impression', u'kkk', u'stephens', u'show', u'rapture', u'photo', u'for', u'sexist']",
[],
[],
"+++: []
---: [u'called', u'responsible', u'particularly', u'libyan', u'sales', u'money', u'supported', u'terrorist', u'month', u'sources']"
],
"type": "scatter",
"x": [
105,
105,
125.98297119140625,
125.98297119140625
],
"xaxis": "x",
"y": [
0,
0.5405631185995701,
0.5405631185995701,
0.5368743566366792
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"+++: [u'the', u'set', u'shot', u'national', u'activists', u'site', u'officers', u'authorities', u'fires', u'seen']
---: [u'monte', u'homes', u'corps', u'hurricane', u'jurisdiction', u'resistance', u'eminent', u'unrest', u'farms', u'mile']",
[],
[],
"+++: []
---: [u'watergate', u'thomas', u'kkk', u'stephens', u'impression', u'rapture', u'photo', u'morons', u'sexist', u'years']"
],
"type": "scatter",
"x": [
90,
90,
115.49148559570312,
115.49148559570312
],
"xaxis": "x",
"y": [
0.5239915229525761,
0.5407990711594035,
0.5407990711594035,
0.5405631185995701
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'credible', u'arnaldo', u'code', u'help', u'founder', u'exclusive', u'series', u'global', u'design', u'gavin']",
[],
[],
"[u'saying', u'answers', u'liar', u'opinions', u'photo', u'reporters', u'networks', u'sources', u'paper', u'scott']"
],
"type": "scatter",
"x": [
335,
335,
345,
345
],
"xaxis": "x",
"y": [
0,
0.5241246859656508,
0.5241246859656508,
0
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'longer', u'nc', u'office', u'switched', u'september', u'pros', u'copy', u'neilson', u'results', u'technicians']",
[],
[],
"+++: [u'comment', u'google', u'videos', u'appeared', u'series', u'twitter', u'share', u'subscribe', u'video', u'article']
---: [u'saying', u'code', u'liar', u'forget', u'founder', u'exclusive', u'dear', u'global', u'danney', u'solutions']"
],
"type": "scatter",
"x": [
325,
325,
340,
340
],
"xaxis": "x",
"y": [
0,
0.5477582438343798,
0.5477582438343798,
0.5241246859656508
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"+++: []
---: [u'set', u'shot', u'national', u'activists', u'site', u'officers', u'communities', u'fires', u'seen', u'protests']",
[],
[],
"+++: [u'comment', u'use', u'mainstream', u'media', u'comments', u'1', u'2', u'radio', u'editor', u'news']
---: [u'45', u'office', u'switched', u'september', u'electoral', u'neilson', u'results', u'technicians', u'years', u'held']"
],
"type": "scatter",
"x": [
102.74574279785156,
102.74574279785156,
332.5,
332.5
],
"xaxis": "x",
"y": [
0.5407990711594035,
0.555896060550066,
0.555896060550066,
0.5477582438343798
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'planetary', u'code', u'closely', u'producer', u'photo', u'astronomical', u'queen', u'confirm', u'years', u'discovered']",
[],
[],
"+++: []
---: [u'comment', u'use', u'mainstream', u'media', u'comments', u'1', u'2', u'radio', u'editor', u'article']"
],
"type": "scatter",
"x": [
75,
75,
217.62287139892578,
217.62287139892578
],
"xaxis": "x",
"y": [
0,
0.5561728330392073,
0.5561728330392073,
0.555896060550066
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'coup', u'checkpoints', u'wakingtimes', u'paragraph', u'jonsdottir', u'knowingly', u'ended', u'lands', u'including', u'parks']",
[],
[],
"+++: []
---: [u'science', u'planetary', u'code', u'closely', u'producer', u'photo', u'astronomical', u'queen', u'soon', u'years']"
],
"type": "scatter",
"x": [
65,
65,
146.3114356994629,
146.3114356994629
],
"xaxis": "x",
"y": [
0,
0.5564856128519003,
0.5564856128519003,
0.5561728330392073
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'morsi', u'phenomenon', u'founder', u'caused', u'labeled', u'mission', u'actress', u'years', u'alien', u'report']",
[],
[],
"+++: []
---: [u'coup', u'checkpoints', u'wakingtimes', u'weapons', u'jonsdottir', u'ended', u'keystone', u'including', u'1962', u'nevada']"
],
"type": "scatter",
"x": [
55,
55,
105.65571784973145,
105.65571784973145
],
"xaxis": "x",
"y": [
0,
0.5704763562651556,
0.5704763562651556,
0.5564856128519003
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'1st', u'now', u'jason', u'help', u'ron', u'demand', u'caused', u'executive', u'dollar', u'damage']",
[],
[],
"+++: []
---: [u'phenomenon', u'founder', u'caused', u'mission', u'actress', u'years', u'alien', u'report', u'bright', u'swedish']"
],
"type": "scatter",
"x": [
45,
45,
80.32785892486572,
80.32785892486572
],
"xaxis": "x",
"y": [
0,
0.5726519085057408,
0.5726519085057408,
0.5704763562651556
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'represent', u'thomas', u'words', u'founder', u'produces', u'rev', u'authors', u'unseen', u'infant', u'rest']",
[],
[],
"+++: []
---: [u'now', u'breaking', u'jason', u'help', u'ron', u'caused', u'executive', u'dollar', u'proposes', u'executes']"
],
"type": "scatter",
"x": [
35,
35,
62.66392946243286,
62.66392946243286
],
"xaxis": "x",
"y": [
0,
0.5985741306483363,
0.5985741306483363,
0.5726519085057408
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'perspective', u'imploding', u'colleges', u'help', u'founder', u'text', u'rob', u'results', u'bookmark', u'professors']",
[],
[],
"+++: []
---: [u'represent', u'thomas', u'birth', u'founder', u'produces', u'child', u'unseen', u'infant', u'rest', u'years']"
],
"type": "scatter",
"x": [
25,
25,
48.83196473121643,
48.83196473121643
],
"xaxis": "x",
"y": [
0,
0.6044867266886239,
0.6044867266886239,
0.5985741306483363
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'rtd', u'thomas', u'shot', u'pti', u'sergei', u'ndtv', u'caused', u'kejriwal', u'gun', u'laura']",
[],
[],
"+++: []
---: [u'imploding', u'colleges', u'help', u'founder', u'text', u'rob', u'results', u'professors', u'facilities', u'spaces']"
],
"type": "scatter",
"x": [
15,
15,
36.915982365608215,
36.915982365608215
],
"xaxis": "x",
"y": [
0,
0.6092748581752581,
0.6092748581752581,
0.6044867266886239
],
"yaxis": "y"
},
{
"hoverinfo": "text",
"marker": {
"color": "rgb(0,116,217)"
},
"mode": "lines",
"text": [
"[u'urinary', u'fungal', u'molecule', u'facial', u'tincture', u'ginseng', u'sciencedaily', u'zen', u'powders', u'narcotic']",
[],
[],
"+++: []
---: [u'rtd', u'thomas', u'shot', u'pti', u'sergei', u'ndtv', u'caused', u'kejriwal', u'officers', u'laura']"
],
"type": "scatter",
"x": [
5,
5,
25.957991182804108,
25.957991182804108
],
"xaxis": "x",
"y": [
0,
0.6439303839488679,
0.6439303839488679,
0.6092748581752581
],
"yaxis": "y"
}
],
"layout": {
"autosize": false,
"height": 600,
"hovermode": "closest",
"showlegend": false,
"width": 1000,
"xaxis": {
"mirror": "allticks",
"rangemode": "tozero",
"showgrid": false,
"showline": true,
"showticklabels": true,
"tickmode": "array",
"ticks": "outside",
"ticktext": [
5,
12,
18,
35,
28,
25,
16,
30,
6,
8,
17,
27,
9,
2,
14,
20,
34,
10,
29,
3,
19,
32,
24,
13,
15,
26,
11,
33,
1,
23,
22,
31,
21,
4,
7
],
"tickvals": [
5,
15,
25,
35,
45,
55,
65,
75,
85,
95,
105,
115,
125,
135,
145,
155,
165,
175,
185,
195,
205,
215,
225,
235,
245,
255,
265,
275,
285,
295,
305,
315,
325,
335,
345
],
"type": "linear",
"zeroline": false
},
"yaxis": {
"mirror": "allticks",
"rangemode": "tozero",
"showgrid": false,
"showline": true,
"showticklabels": true,
"ticks": "outside",
"type": "linear",
"zeroline": false
}
}
},
"text/html": [
"