Skip to content

Commit f09175c

Browse files
authored
Clean up (#175)
1 parent 596ef1f commit f09175c

File tree

2 files changed

+1
-32
lines changed

2 files changed

+1
-32
lines changed

settings.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ status = 2
2727
# Optional. Same format as setuptools requirements. Torch version seems to effect random number generator (not 100% certain).
2828
# TODO (Sam): our goal is to rely on as few 3rd party packages as possible. We should try to remove as many of these as possible and integrate torch code directly.
2929
# NOTE (Sam): is it possible to specify no-deps here?
30-
requirements = Cython pytest phonemizer inflect librosa>=0.8.0 matplotlib nltk>=3.6.5 numpy>=1.23.5 csvw clldutils pandas pydub scipy scikit-learn soundfile tensorboardX torch>=1.13.0 torchaudio>=0.9.0 unidecode seaborn mdutils wordcloud wordfreq Pillow einops g2p_en@git+https://github.com/uberduck-ai/g2p emoji text-unidecode gdown pre-commit lmdb ray[default] praat-parselmouth>=0.4.3
30+
requirements = Cython pytest phonemizer inflect librosa>=0.8.0 matplotlib nltk>=3.6.5 numpy>=1.23.5 pandas pydub scipy scikit-learn tensorboardX torch>=1.13.0 torchaudio>=0.9.0 unidecode seaborn wordfreq einops g2p_en@git+https://github.com/uberduck-ai/g2p emoji text-unidecode pre-commit lmdb ray[default] praat-parselmouth>=0.4.3
3131

3232
# Optional. Same format as setuptools console_scripts
3333
# console_scripts =

uberduck_ml_dev/data/statistics.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,8 @@
1313
import os
1414

1515
import librosa
16-
import matplotlib.pyplot as plt
1716
import numpy as np
18-
from PIL import Image, ImageOps
1917
from pydub.utils import mediainfo_json
20-
import seaborn as sns
21-
from wordcloud import WordCloud, STOPWORDS
2218
from wordfreq import word_frequency
2319

2420
from ..text.utils import text_to_sequence
@@ -36,33 +32,6 @@ def word_frequencies(text: str, language: str = "en") -> List[float]:
3632
return freqs
3733

3834

39-
def create_wordcloud(text: str, output_file: str):
40-
"""
41-
Creates and saves a wordcloud in the shape of a duck to the designated output file.
42-
"""
43-
dir_path = os.path.dirname(os.path.realpath(__file__))
44-
45-
mask = np.array(
46-
ImageOps.invert(
47-
Image.open(os.path.join(dir_path, "../assets/duck.png")).convert("RGB")
48-
)
49-
)
50-
wc = WordCloud(
51-
background_color="white",
52-
max_words=3000,
53-
mask=mask,
54-
contour_width=7,
55-
contour_color="steelblue",
56-
)
57-
frequency_dict = dict(Counter(text.lower().split()).most_common())
58-
for k in STOPWORDS:
59-
if k in frequency_dict.keys():
60-
frequency_dict.pop(k)
61-
62-
wc.generate_from_frequencies(frequency_dict)
63-
wc.to_file(output_file)
64-
65-
6635
def count_frequency(arr: List[Any]) -> Dict[Any, int]:
6736
"""
6837
Calculates the frequency that a value appears in a list

0 commit comments

Comments
 (0)