Spaces:
Runtime error
Runtime error
patrickvonplaten
commited on
Commit
•
a87bd77
1
Parent(s):
9fec05e
up
Browse files
app.py
CHANGED
@@ -17,6 +17,8 @@ print("pandoc", pypandoc.__version__)
|
|
17 |
#document.add_heading('Labels for ', level=1)
|
18 |
RESULTS_FOLDER = "./results"
|
19 |
|
|
|
|
|
20 |
CAT_TO_CODEWORDS = {
|
21 |
"Prejudices": ["prejudice", "judge", "preconceive", "stigma", "assumption", "assume", "misunderstanding", "unexamined", "distorted", "clear", "compar"],
|
22 |
"Self-knowledge": ["self-knowledge", "self-awareness", "introspection", "examined", "myself", "realization", "belief"],
|
@@ -105,7 +107,6 @@ def main(filename, codewords_mapping):
|
|
105 |
|
106 |
|
107 |
def convert(*keywords):
|
108 |
-
cached_folder = snapshot_download("claudiag/atlas", token=os.environ.get("HF_TOKEN"))
|
109 |
codewords_mapping = {k: v for k,v in zip(CATEGORIES, keywords)}
|
110 |
|
111 |
num_files = 0
|
@@ -114,7 +115,7 @@ def convert(*keywords):
|
|
114 |
os.makedirs(RESULTS_FOLDER)
|
115 |
|
116 |
result_files = []
|
117 |
-
for folder in tqdm.tqdm(glob.glob(os.path.join(
|
118 |
all_files = tqdm.tqdm(glob.glob(f"./{folder}/*"))
|
119 |
num_files += len(all_files)
|
120 |
|
|
|
17 |
#document.add_heading('Labels for ', level=1)
|
18 |
RESULTS_FOLDER = "./results"
|
19 |
|
20 |
+
DOC_FOLDER = snapshot_download("claudiag/atlas", token=os.environ.get("HF_TOKEN"))
|
21 |
+
|
22 |
CAT_TO_CODEWORDS = {
|
23 |
"Prejudices": ["prejudice", "judge", "preconceive", "stigma", "assumption", "assume", "misunderstanding", "unexamined", "distorted", "clear", "compar"],
|
24 |
"Self-knowledge": ["self-knowledge", "self-awareness", "introspection", "examined", "myself", "realization", "belief"],
|
|
|
107 |
|
108 |
|
109 |
def convert(*keywords):
|
|
|
110 |
codewords_mapping = {k: v for k,v in zip(CATEGORIES, keywords)}
|
111 |
|
112 |
num_files = 0
|
|
|
115 |
os.makedirs(RESULTS_FOLDER)
|
116 |
|
117 |
result_files = []
|
118 |
+
for folder in tqdm.tqdm(glob.glob(os.path.join(DOC_FOLDER, "/*"))):
|
119 |
all_files = tqdm.tqdm(glob.glob(f"./{folder}/*"))
|
120 |
num_files += len(all_files)
|
121 |
|