kunaldahiya / pyxclib

Tools for multi-label classification problems.
MIT License
126 stars 36 forks source link

Error running compute_features example #4

Closed venomouscyanide closed 4 years ago

venomouscyanide commented 4 years ago

Hey I was trying out this repo by running the compute_features() example in xclib/examples/compute_features.py Unfortunately I keep running into this error TypeError: 'BoWFeatures' object is not iterable

Full Trace:

Traceback (most recent call last):
  File "/home/user/pyxclib/xclib/examples/compute_features.py", line 26, in <module>
    compute_features()
  File "/home/user/pyxclib/xclib/examples/compute_features.py", line 22, in compute_features
    print(obj.transform(obj).toarray())
  File "/home/user/pyxclib/xclib/utils/text.py", line 504, in transform
    X = self._compute_countf(raw_documents)
  File "/home/user/pyxclib/xclib/utils/text.py", line 535, in _compute_countf
    for doc in raw_documents:
TypeError: 'BoWFeatures' object is not iterable

Please help me out in debugging the issue.

anshumitts commented 4 years ago

Hi @venomouscyanide

Thank you for pointing this out. As it turned out we made a mistake (our bad :/ ) and passed wrong variable in the transform function. You can use the example now and it should work as expected.

PS: I am simply confirming this will only create BoW features.

All the best for your work. AM

venomouscyanide commented 4 years ago

Closing as fixed in a78cf4779ae121c63df074154225cf67a4852f21 Thanks @anshumitts