danieldux commited on
Commit
4197e21
·
1 Parent(s): 4c644ed

Update ISCO structure data source

Browse files
Files changed (1) hide show
  1. metric_template_1.py +6 -6
metric_template_1.py CHANGED
@@ -18,6 +18,7 @@ import datasets
18
  import ham
19
  import os
20
  import isco
 
21
 
22
 
23
  # TODO: Add BibTeX citation
@@ -57,10 +58,8 @@ Examples:
57
  """
58
 
59
  # TODO: Define external resources urls if needed
60
- BAD_WORDS_URL = "http://url/to/external/resource/bad_words.txt"
61
- ISCO_HIERARCHY_URL = (
62
- "https://storage.googleapis.com/isco-public/tables/ISCO_structure.csv"
63
- )
64
 
65
 
66
  @evaluate.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
@@ -94,9 +93,10 @@ class MetricTemplate1(evaluate.Metric):
94
  # TODO: Download external resources if needed
95
 
96
  # Download and prepare the ISCO structure csv file
97
- isco_csv = dl_manager.download_and_extract(ISCO_HIERARCHY_URL)
98
  print(f"ISCO CSV file downloaded")
99
- self.isco_hierarchy = isco.create_hierarchy_dict(isco_csv)
 
100
  print("ISCO hierarchy dictionary created")
101
  print(self.isco_hierarchy)
102
 
 
18
  import ham
19
  import os
20
  import isco
21
+ import json
22
 
23
 
24
  # TODO: Add BibTeX citation
 
58
  """
59
 
60
  # TODO: Define external resources urls if needed
61
+ ISCO_CSV_URL = "https://storage.googleapis.com/isco-public/tables/ISCO_structure.csv"
62
+ ISCO_JSON_URL = "https://storage.googleapis.com/isco-public/tables/isco_structure.json"
 
 
63
 
64
 
65
  @evaluate.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
 
93
  # TODO: Download external resources if needed
94
 
95
  # Download and prepare the ISCO structure csv file
96
+ isco_csv = dl_manager.download_and_extract(ISCO_CSV_URL)
97
  print(f"ISCO CSV file downloaded")
98
+ # self.isco_hierarchy = isco.create_hierarchy_dict(isco_csv)
99
+ self.isco_hierarchy: dict = json.load(ISCO_JSON_URL)
100
  print("ISCO hierarchy dictionary created")
101
  print(self.isco_hierarchy)
102