Spaces:
Sleeping
Sleeping
Commit
·
60d53e2
1
Parent(s):
2b39b33
Update classifier.py
Browse files- classifier/classifier.py +7 -1
classifier/classifier.py
CHANGED
@@ -55,6 +55,11 @@ class ThemeClassifier:
|
|
55 |
|
56 |
def get_themes(self, path, save_path=None):
|
57 |
|
|
|
|
|
|
|
|
|
|
|
58 |
# Load dataset
|
59 |
df = load_subs(path)
|
60 |
|
@@ -67,4 +72,5 @@ class ThemeClassifier:
|
|
67 |
# Save Output
|
68 |
if save_path:
|
69 |
df.to_csv(save_path, index=False)
|
70 |
-
|
|
|
|
55 |
|
56 |
def get_themes(self, path, save_path=None):
|
57 |
|
58 |
+
# Read Save Output if Exists
|
59 |
+
if save_path is not None and os.path.exists(save_path):
|
60 |
+
df = pd.read_csv(save_path)
|
61 |
+
return df
|
62 |
+
|
63 |
# Load dataset
|
64 |
df = load_subs(path)
|
65 |
|
|
|
72 |
# Save Output
|
73 |
if save_path:
|
74 |
df.to_csv(save_path, index=False)
|
75 |
+
|
76 |
+
return df
|