word-cloud

Right to Left alignment not working in Python Word Cloud

不想你离开。 提交于 2021-02-19 05:36:05
问题 There's this library, persian-word-cloud, which is a fork of word_cloud. In the example directory of this library, there's this example, with_mask.py, which uses twitter-logo.jpg to create a word cloud from persian.txt. The output should look like this: But when I install the package using pip install persian_wordcloud and run the same script, the output looks like this: As you can see, the direction of the words are wrong. How can I fix this? Also, the problem seems to be with version 3.8.1

How to remove non UTF-8 characters from text

放肆的年华 提交于 2021-02-17 06:25:07
问题 I need help removing non UTF-8 character from my word cloud. So far this is my code. I've tried gsub and removeWords and they are still there in my word cloud and I do not know what to do to get rid of them. Any help would be appreciated. Thank you for your time. txt <- readLines("11-0.txt") corpus = VCorpus(VectorSource(txt)) gsub("’","‘","",txt) corpus = tm_map(corpus, content_transformer(tolower)) corpus = tm_map(corpus, removeWords, stopwords("english")) corpus = tm_map(corpus,

Customised Word Cloud in two different colors in R

与世无争的帅哥 提交于 2021-01-27 21:00:32
问题 I am trying to create a word cloud in R, wherein I have a matrix with positive and negative words, however, I want to show positive and negative words in two different colors (say green and red). Can someone please help me on this. Thanks! library(qdap) x1 = x[a0] pol = polarity(x1) wc = pol$all[,2] val = pol$all[,3] p = pol$all[,4] n = pol$all[,5] positive_words = unique(setdiff(unlist(p),"-")) # Positive words list negative_words = unique(setdiff(unlist(n),"-")) # Negative words list total

wordcloud encoding in shinyapps

雨燕双飞 提交于 2021-01-27 13:56:14
问题 I deplyed my shiny code with wordcloud package. My local pc can shows perfectly but shinyapps show codes not characters. My local one is window with no UTF-8, and other local is Ubuntu with UTF-8 both can shows good. How can I fix it? sample code server.R library(wordcloud) function(input, output, session) { d1 <- c("강릉교동짬뽕","강릉선교장","강릉오죽헌","강문해변","경포대") d2 <- c(35,126,192,322,452) d3 <- data.frame(poi_name=d1, n=d2) spider_cloud <- d3 output$spider_cloud <- renderPlot({ wordcloud_tmp <-

adding words to stopwords in wordcloud does not work

痴心易碎 提交于 2020-08-09 01:44:06
问题 I want to add some stopwords to wordcloud but the resulting image shows the exact words I add to the stopwords. I am doing something wrong? How can I add the word to the stopwords from wordcloud import STOPWORDS as EN_STOPWORDS from wordcloud import ImageColorGenerator from stopword_persian import stopword_persian as STOPWORDS from wordcloud_fa import WordCloudFa # Add another stopword STOPWORDS.add('ميساخته') stopwords = STOPWORDS.union(EN_STOPWORDS) # Generate a word cloud image wordcloud =

How to create a wordcloud according to frequencies in a pandas dataframe?

怎甘沉沦 提交于 2020-07-05 20:57:35
问题 I have to plot a wordcloud. 'tweets.csv' is a Pandas dataframe which has a column named 'text'. The ploted graph hasn't been based on the most common words, tough. How can the words sizes be linked to their frequencies in dataframe? text = df_final.text.values wordcloud = WordCloud( #mask = logomask, max_words = 1000, width = 600, height = 400, #max_font_size = 1000, #min_font_size = 100, normalize_plurals = True, #scale = 5, #relative_scaling = 0, background_color = 'black', stopwords =

How to create a wordcloud according to frequencies in a pandas dataframe?

自古美人都是妖i 提交于 2020-07-05 20:54:57
问题 I have to plot a wordcloud. 'tweets.csv' is a Pandas dataframe which has a column named 'text'. The ploted graph hasn't been based on the most common words, tough. How can the words sizes be linked to their frequencies in dataframe? text = df_final.text.values wordcloud = WordCloud( #mask = logomask, max_words = 1000, width = 600, height = 400, #max_font_size = 1000, #min_font_size = 100, normalize_plurals = True, #scale = 5, #relative_scaling = 0, background_color = 'black', stopwords =

Why are stop words not being excluded from the word cloud when using Python's wordcloud library?

妖精的绣舞 提交于 2020-06-28 04:04:43
问题 I want to exclude 'The', 'They' and 'My' from being displayed in my word cloud. I'm using the python library 'wordcloud' as below, and updating the STOPWORDS list with these 3 additional stopwords, but the wordcloud is still including them. What do I need to change so that these 3 words are excluded? The libraries I imported are: import numpy as np import pandas as pd from wordcloud import WordCloud, STOPWORDS import matplotlib.pyplot as plt I've tried adding elements to the STOPWORDS set at

Why are stop words not being excluded from the word cloud when using Python's wordcloud library?

倾然丶 夕夏残阳落幕 提交于 2020-06-28 04:03:54
问题 I want to exclude 'The', 'They' and 'My' from being displayed in my word cloud. I'm using the python library 'wordcloud' as below, and updating the STOPWORDS list with these 3 additional stopwords, but the wordcloud is still including them. What do I need to change so that these 3 words are excluded? The libraries I imported are: import numpy as np import pandas as pd from wordcloud import WordCloud, STOPWORDS import matplotlib.pyplot as plt I've tried adding elements to the STOPWORDS set at

In WordCloud on Python I would like to merge two languages

一世执手 提交于 2020-05-13 23:15:41
问题 In WordCloud on Python I would like to merge two languages ​​into one picture (English, Arabic) but I was unable to add the Arabic language as you see a squares instead of words and when I call the Arabic_reshaper library and make it read the csv file It shows me the Arabic language and make the English language as a squares wordcloud = WordCloud( collocations = False, width=1600, height=800, background_color='white', stopwords=stopwords, max_words=150, random_state=42, #font_path='/Users/mac