OleehyO commited on
Commit
7405a5a
1 Parent(s): f2f5216

Update latex-formulas.py

Browse files
Files changed (1) hide show
  1. latex-formulas.py +4 -4
latex-formulas.py CHANGED
@@ -24,7 +24,7 @@ class LatexFormulas(datasets.GeneratorBasedBuilder):
24
  data_url=RAW_METADATA_URL
25
  ),
26
  LatexFormulasConfig(
27
- name="tokenized_formulas",
28
  data_url=DIR_URL
29
  )
30
  ]
@@ -36,7 +36,7 @@ class LatexFormulas(datasets.GeneratorBasedBuilder):
36
  "latex_formula": datasets.Value("string")
37
  })
38
  )
39
- if self.config.name == "tokenized_formulas":
40
  return datasets.DatasetInfo(
41
  features=datasets.Features({
42
  "image": datasets.Image(),
@@ -56,7 +56,7 @@ class LatexFormulas(datasets.GeneratorBasedBuilder):
56
  )
57
  ]
58
 
59
- if self.config.name == "tokenized_formulas":
60
  # dir_path = Path(data_path)
61
  # dir_path = Path(dl_manager.download_and_extract(data_path))
62
  dir_path = Path(dl_manager.download_and_extract(self.config.data_url)) / 'common_formulas'
@@ -73,7 +73,7 @@ class LatexFormulas(datasets.GeneratorBasedBuilder):
73
  ]
74
 
75
  def _generate_examples(self, data_path=None, dir_path: Path=None, dl_manager=None):
76
- if self.config.name == 'tokenized_formulas':
77
  idx = 0
78
  for directory in dir_path.iterdir():
79
  if not directory.is_dir():
 
24
  data_url=RAW_METADATA_URL
25
  ),
26
  LatexFormulasConfig(
27
+ name="cleaned_formulas",
28
  data_url=DIR_URL
29
  )
30
  ]
 
36
  "latex_formula": datasets.Value("string")
37
  })
38
  )
39
+ if self.config.name == "cleaned_formulas":
40
  return datasets.DatasetInfo(
41
  features=datasets.Features({
42
  "image": datasets.Image(),
 
56
  )
57
  ]
58
 
59
+ if self.config.name == "cleaned_formulas":
60
  # dir_path = Path(data_path)
61
  # dir_path = Path(dl_manager.download_and_extract(data_path))
62
  dir_path = Path(dl_manager.download_and_extract(self.config.data_url)) / 'common_formulas'
 
73
  ]
74
 
75
  def _generate_examples(self, data_path=None, dir_path: Path=None, dl_manager=None):
76
+ if self.config.name == 'cleaned_formulas':
77
  idx = 0
78
  for directory in dir_path.iterdir():
79
  if not directory.is_dir():