Spaces:
Runtime error
Runtime error
lfs
Browse files- .gitattributes +4 -0
- app.py +25 -0
- ipaexm00401/IPA_Font_License_Agreement_v1.0.txt +3 -0
- ipaexm00401/Readme_ipaexm00401.txt +3 -0
- ipaexm00401/ipaexm.ttf +3 -0
- requirements.txt +64 -0
.gitattributes
CHANGED
|
@@ -32,3 +32,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
ipaexm00401/Readme_ipaexm00401.txt filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
ipaexm00401/ipaexm.ttf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
ipaexm00401/IPA_Font_License_Agreement_v1.0.txt filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
ipaexm00401/* filter=lfs diff=lfs merge=lfs -text
|
app.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from janome.tokenizer import Tokenizer
|
| 2 |
+
from wordcloud import WordCloud
|
| 3 |
+
import gradio as gr
|
| 4 |
+
from PIL import Image
|
| 5 |
+
|
| 6 |
+
def generate_cloud(text):
|
| 7 |
+
t = Tokenizer()
|
| 8 |
+
|
| 9 |
+
tokens = t.tokenize(text)
|
| 10 |
+
|
| 11 |
+
wc = WordCloud(width=480, height=320, regexp="[\w']+", font_path="./ipaexm00401/ipaexm.ttf")
|
| 12 |
+
nouns = [token.base_form for token in tokens if token.part_of_speech.startswith('名詞')]
|
| 13 |
+
nouns = (" ").join(nouns)
|
| 14 |
+
wc.generate(nouns)
|
| 15 |
+
wc.to_file("./wordcloud.png")
|
| 16 |
+
image = Image.open("./wordcloud.png")
|
| 17 |
+
return image
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
gr.Interface(
|
| 21 |
+
fn=generate_cloud,
|
| 22 |
+
inputs="text",
|
| 23 |
+
outputs=gr.Image(type="pil"),
|
| 24 |
+
title="WordCloud Demonstration"
|
| 25 |
+
).launch()
|
ipaexm00401/IPA_Font_License_Agreement_v1.0.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4c84dd528ec3044638ec346fc1ee27cd1eb95dfc04cbc6a881b3ca7a7f517e54
|
| 3 |
+
size 20564
|
ipaexm00401/Readme_ipaexm00401.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:783ec2703d860575f5eab15bb2b3168da2a8cca76505a1b4fce3cc1ce58694b3
|
| 3 |
+
size 1693
|
ipaexm00401/ipaexm.ttf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7a306386f930fee80922f71eebf4ffe0f1ff2817da8e619230953487673d71c7
|
| 3 |
+
size 7835672
|
requirements.txt
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
aiofiles==22.1.0
|
| 2 |
+
aiohttp==3.8.3
|
| 3 |
+
aiosignal==1.3.1
|
| 4 |
+
altair==4.2.0
|
| 5 |
+
anyio==3.6.2
|
| 6 |
+
async-timeout==4.0.2
|
| 7 |
+
attrs==22.2.0
|
| 8 |
+
certifi==2022.12.7
|
| 9 |
+
charset-normalizer==2.1.1
|
| 10 |
+
click==8.1.3
|
| 11 |
+
contourpy==1.0.7
|
| 12 |
+
cycler==0.11.0
|
| 13 |
+
entrypoints==0.4
|
| 14 |
+
fastapi==0.89.1
|
| 15 |
+
ffmpy==0.3.0
|
| 16 |
+
fonttools==4.38.0
|
| 17 |
+
frozenlist==1.3.3
|
| 18 |
+
fsspec==2023.1.0
|
| 19 |
+
gradio==3.16.2
|
| 20 |
+
h11==0.14.0
|
| 21 |
+
httpcore==0.16.3
|
| 22 |
+
httpx==0.23.3
|
| 23 |
+
idna==3.4
|
| 24 |
+
importlib-resources==5.10.2
|
| 25 |
+
Janome==0.4.2
|
| 26 |
+
Jinja2==3.1.2
|
| 27 |
+
jsonschema==4.17.3
|
| 28 |
+
kiwisolver==1.4.4
|
| 29 |
+
linkify-it-py==1.0.3
|
| 30 |
+
markdown-it-py==2.1.0
|
| 31 |
+
MarkupSafe==2.1.2
|
| 32 |
+
matplotlib==3.6.3
|
| 33 |
+
mdit-py-plugins==0.3.3
|
| 34 |
+
mdurl==0.1.2
|
| 35 |
+
multidict==6.0.4
|
| 36 |
+
numpy==1.24.1
|
| 37 |
+
orjson==3.8.5
|
| 38 |
+
packaging==23.0
|
| 39 |
+
pandas==1.5.3
|
| 40 |
+
Pillow==9.4.0
|
| 41 |
+
pkgutil_resolve_name==1.3.10
|
| 42 |
+
pycryptodome==3.16.0
|
| 43 |
+
pydantic==1.10.4
|
| 44 |
+
pydub==0.25.1
|
| 45 |
+
pyparsing==3.0.9
|
| 46 |
+
pyrsistent==0.19.3
|
| 47 |
+
python-dateutil==2.8.2
|
| 48 |
+
python-multipart==0.0.5
|
| 49 |
+
pytz==2022.7.1
|
| 50 |
+
PyYAML==6.0
|
| 51 |
+
requests==2.28.2
|
| 52 |
+
rfc3986==1.5.0
|
| 53 |
+
six==1.16.0
|
| 54 |
+
sniffio==1.3.0
|
| 55 |
+
starlette==0.22.0
|
| 56 |
+
toolz==0.12.0
|
| 57 |
+
typing_extensions==4.4.0
|
| 58 |
+
uc-micro-py==1.0.1
|
| 59 |
+
urllib3==1.26.14
|
| 60 |
+
uvicorn==0.20.0
|
| 61 |
+
websockets==10.4
|
| 62 |
+
wordcloud==1.8.2.2
|
| 63 |
+
yarl==1.8.2
|
| 64 |
+
zipp==3.11.0
|