Erudite AI & Knowledge 头像

消息来源频道

Erudite AI & Knowledge

@challengeanewlife

频道207 位成员公开可见0 人在线

随手分享资源,不能保量但基本能保质。 所有的工具但凡发布都基本上会自己长期坚持使用;所有书本相关但凡发布我至少读过一次,网页我至少玩过5分钟┐(´-`)┌。 学知识最忌打一枪换一炮,好想知道了很多承,但其实都没学会啥;用起来很关键。 每一段时间会有一个主题,主要是和自己研究和玩的东西。 想要投稿或者分享可以投稿私聊我投稿。

成员规模207 位成员
在线情况0 人在线
消息总数1,135 条消息
浏览量总数0 次浏览

在这个频道里搜索消息……

t.me/challengeanewlife

import numpy as np
from PIL import Image
from PIL import ImageOps
from wordcloud import STOPWORDS
from wordcloud import WordCloud as wc
import matplotlib.pyplot as plt
import os
# Step 1: Change the current working directory to the directory of the script being run
os.chdir(os.path.dirname(os.path.abspath(file)))
# Step 2.1: Load your image
mask = np.array(Image.open("image.png"))
# Step 5: Clean your text data
text = '''
The software supports various image formats, including RAW, and offers fast thumbnail preview, zoomable grid preview of thumbnails, and display of exif information. It allows for a framless view and change of transparency of windows. It also offers file filtering, searching, and sorting, improved anti-aliasing, hiding of menubar and toolbar, slideshow image information, play/pause with user defined time interval, and adjustable background color. The software also enables image editing such as cropping, resizing, pseudo color function, color adjustments, multi page TIFF export, rotating images, drag and drop images, automatically saving screenshots, deleting/renaming images, creating mosaic image, and setting wallpaper. Additionally, the software offers viewer synchronization for multiple instances, synchronized zooming and panning, synchronized next/previous file, overlay of two or more instances with changing opacity, and arrangement of synchronized instances. It also enables synchronization of multiple instances in the LAN and sending of images over LAN connection. Finally, the software supports various file extensions for reading and writing with comments.
your text data'''
cleaned_text = " ".join([word for word in text.split() if word not in STOPWORDS])
# Step 5: Generate the wordcloud using the cleaned text and the mask.png as the shape
wordcloud = wc(background_color="white", max_words=2000, mask=mask, contour_width=3, contour_color='steelblue').generate(cleaned_text)
# Step 6: Display the wordcloud
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis("off")
plt.show()