Spaces:
Sleeping
Sleeping
Andrew Green
commited on
Commit
·
152ae6f
1
Parent(s):
c23cd24
Reinstate label translation
Browse files
app.py
CHANGED
@@ -40,9 +40,7 @@ def classify_abstracts(abstracts:Dict[str, str],batch_size=64, progress=gr.Progr
|
|
40 |
# for i in range(0, len(abstracts), batch_size):
|
41 |
# classification.extend(pipe(abstracts_list[i:i+batch_size]))
|
42 |
|
43 |
-
|
44 |
-
# abs['label'] = label_lookup[abs['label']]
|
45 |
-
# abs['pmid'] = pmid
|
46 |
|
47 |
# return classification
|
48 |
results = []
|
@@ -80,7 +78,9 @@ def classify_abstracts(abstracts:Dict[str, str],batch_size=64, progress=gr.Progr
|
|
80 |
except Exception as e:
|
81 |
print(f"Error classifying batch starting at index {i}: {str(e)}")
|
82 |
continue
|
83 |
-
|
|
|
|
|
84 |
progress(1.0, desc="Classification complete!")
|
85 |
return results
|
86 |
|
|
|
40 |
# for i in range(0, len(abstracts), batch_size):
|
41 |
# classification.extend(pipe(abstracts_list[i:i+batch_size]))
|
42 |
|
43 |
+
|
|
|
|
|
44 |
|
45 |
# return classification
|
46 |
results = []
|
|
|
78 |
except Exception as e:
|
79 |
print(f"Error classifying batch starting at index {i}: {str(e)}")
|
80 |
continue
|
81 |
+
for pmid, abs in zip(pmids, results):
|
82 |
+
abs['label'] = label_lookup[abs['label']]
|
83 |
+
abs['pmid'] = pmid
|
84 |
progress(1.0, desc="Classification complete!")
|
85 |
return results
|
86 |
|