Update app.py
Browse files
app.py
CHANGED
@@ -5,12 +5,12 @@ from py_thesaurus import Thesaurus
|
|
5 |
import random
|
6 |
|
7 |
# Cache the NLTK corpora and functions for better performance
|
8 |
-
@st.cache
|
9 |
def load_nltk_data():
|
10 |
-
nltk.download('
|
11 |
-
from nltk.
|
12 |
|
13 |
-
return
|
14 |
|
15 |
# Function to generate random text from NLTK corpora
|
16 |
def generate_text():
|
|
|
5 |
import random
|
6 |
|
7 |
# Cache the NLTK corpora and functions for better performance
|
8 |
+
@st.cache(allow_output_mutation=True)
|
9 |
def load_nltk_data():
|
10 |
+
nltk.download('gutenberg')
|
11 |
+
from nltk.corpus import gutenberg
|
12 |
|
13 |
+
return gutenberg.words('austen-emma.txt')
|
14 |
|
15 |
# Function to generate random text from NLTK corpora
|
16 |
def generate_text():
|