|
125 | 125 | "outputs": [], |
126 | 126 | "source": [ |
127 | 127 | "# Query data from graph database\n", |
128 | | - "words = query_cypher_to_data_frame(\"../cypher/Overview/Words_for_Wordcloud.cypher\")\n", |
129 | | - "words.head(20)" |
| 128 | + "words = query_cypher_to_data_frame(\"../cypher/Overview/Words_for_universal_Wordcloud.cypher\")\n", |
| 129 | + "words.head(30)" |
130 | 130 | ] |
131 | 131 | }, |
132 | 132 | { |
|
141 | 141 | "number_of_words=len(words.word)\n", |
142 | 142 | "print(\"There are {} words in the dataset.\".format(number_of_words))\n", |
143 | 143 | "\n", |
| 144 | + "# Define stop words\n", |
| 145 | + "stopwords = set(STOPWORDS)\n", |
| 146 | + "stopwords.update(['builder', 'exception', 'abstract', 'helper', 'util', 'callback', 'factory', 'result',\n", |
| 147 | + " 'handler', 'type', 'module', 'name', 'parameter', 'lambda', 'access', 'create', 'message', \n", |
| 148 | + " 'ts', 'js', 'tsx', 'jsx', 'css', 'htm', 'html', 'props', 'use', 'id', 'ref', 'hook', 'event', \n", |
| 149 | + " 'span', 'data', 'context', 'form', 'get', 'set', 'object', 'null', 'new'])\n", |
| 150 | + "\n", |
144 | 151 | "if number_of_words > 0:\n", |
145 | | - " # Define stop words\n", |
146 | | - " stopwords = set(STOPWORDS)\n", |
147 | | - " stopwords.update(['builder', 'exception', 'abstract', 'helper', 'util', 'callback', 'factory', 'handler', 'repository', 'result'])\n", |
148 | | - " wordcloud = WordCloud(stopwords=stopwords, background_color='white', colormap='viridis').generate(text)\n", |
| 152 | + " wordcloud = WordCloud(\n", |
| 153 | + " width=800, \n", |
| 154 | + " height=400,\n", |
| 155 | + " max_words=400, \n", |
| 156 | + " stopwords=stopwords,\n", |
| 157 | + " background_color='white', \n", |
| 158 | + " colormap='viridis'\n", |
| 159 | + " ).generate(text)\n", |
149 | 160 | "\n", |
150 | 161 | " # Plot the word cloud\n", |
151 | 162 | " plot.figure(figsize=(15,10))\n", |
|
0 commit comments