Describe the bug: got KeyError when printing out Dataset object. This is because the 'loader' attribute only initializes when Dataset uses build(...) function.
File "/Users/Desktop/Dependency-Parsing/supar/utils/data.py", line 45, in __repr__
if hasattr(self, 'loader'):
File "/Users/Desktop/Dependency-Parsing/supar/utils/data.py", line 66, in __getattr__
return [getattr(sentence, name) for sentence in self.sentences]
File "/Users/Desktop/Dependency-Parsing/supar/utils/data.py", line 66, in <listcomp>
return [getattr(sentence, name) for sentence in self.sentences]
File "/Users/Desktop/Dependency-Parsing/supar/utils/transform.py", line 111, in __getattr__
return self.values[self.maps[name]]
KeyError: 'loader'
Hi, thank you for your amazing work.
Describe the bug: got KeyError when printing out Dataset object. This is because the 'loader' attribute only initializes when Dataset uses
build(...)
function.To reproduce: print out a Dataset object
Example:
Expected behavior: Dataset object can be printed out
Version: MacOS BigSur