Hassan Shavarani
commited on
Commit
•
f79c918
1
Parent(s):
fe5017b
Update example_data_reader.py
Browse files- example_data_reader.py +3 -1
example_data_reader.py
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
Created May 2, 2024.
|
4 |
Copyright Hassan S. Shavarani
|
5 |
"""
|
|
|
6 |
import json
|
7 |
import datetime
|
8 |
from zipfile import ZipFile
|
@@ -103,7 +104,8 @@ class SHINRA5LDS:
|
|
103 |
return self.__next__()
|
104 |
|
105 |
if __name__ == "__main__":
|
106 |
-
|
|
|
107 |
for article, annotation in tqdm(SHINRA5LDS('SHINRA-5LDS.zip', 'en')):
|
108 |
print('='*80)
|
109 |
print(article.title, annotation.labels.values)
|
|
|
3 |
Created May 2, 2024.
|
4 |
Copyright Hassan S. Shavarani
|
5 |
"""
|
6 |
+
import os
|
7 |
import json
|
8 |
import datetime
|
9 |
from zipfile import ZipFile
|
|
|
104 |
return self.__next__()
|
105 |
|
106 |
if __name__ == "__main__":
|
107 |
+
if "SHINRA-5LDS.zip" not in os.listdir():
|
108 |
+
download_url_to_file("https://huggingface.co/datasets/sshavara/SHINRA-5LDS/resolve/main/SHINRA-5LDS.zip?download=true", "SHINRA-5LDS.zip", progress=True)
|
109 |
for article, annotation in tqdm(SHINRA5LDS('SHINRA-5LDS.zip', 'en')):
|
110 |
print('='*80)
|
111 |
print(article.title, annotation.labels.values)
|