Dabs commited on
Commit
14ea41e
1 Parent(s): 47dda48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,10 +8,10 @@ import gradio as gr
8
 
9
 
10
  def create_wc(text, lang, custom_sw, input_img, color_rgb):
11
- for csw in custom_sw.split(","):
12
- text = text.replace(csw, "")
13
  STOPWORDS = set(get_stop_words(lang))
14
  STOPWORDS.update(custom_sw.replace(" ", "").split(","))
 
 
15
  mask = np.array(input_img)
16
  text_dict = Counter(text.lower().split())
17
  wordcloud = WordCloud(background_color="rgba(0, 0, 0, 0)", mode="RGBA",mask=mask, width=1000, height=1500, stopwords=STOPWORDS).generate_from_frequencies(text_dict)
 
8
 
9
 
10
  def create_wc(text, lang, custom_sw, input_img, color_rgb):
 
 
11
  STOPWORDS = set(get_stop_words(lang))
12
  STOPWORDS.update(custom_sw.replace(" ", "").split(","))
13
+ for csw in STOPWORDS:
14
+ text = text.replace(csw, "")
15
  mask = np.array(input_img)
16
  text_dict = Counter(text.lower().split())
17
  wordcloud = WordCloud(background_color="rgba(0, 0, 0, 0)", mode="RGBA",mask=mask, width=1000, height=1500, stopwords=STOPWORDS).generate_from_frequencies(text_dict)