Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Python library with 2.0 paragraph collection #15

Closed
fedenanni opened this issue Mar 7, 2018 · 0 comments
Closed

Issue with Python library with 2.0 paragraph collection #15

fedenanni opened this issue Mar 7, 2018 · 0 comments

Comments

@fedenanni
Copy link

Hi - I've updated the trec_car library to the latest update. With the following code I received the error message I posted below:

from trec_car.read_data import *

ct = 0

with open("../release-v2.0/paragraphCorpus/dedup.articles-paragraphs.cbor", 'rb') as f: #16GB
for p in iter_paragraphs(f):
ct += 1

##########

AssertionError
Traceback (most recent call last)
in ()
4
5 with open("../release-v2.0/paragraphCorpus/dedup.articles-paragraphs.cbor", 'rb') as f: #16GB
----> 6 for p in iter_paragraphs(f):
7 ct += 1
8 print (ct)

~/anaconda2/envs/py36/lib/python3.6/site-packages/trec_car/read_data.py in iter_paragraphs(file)
246 while True:
247 try:
--> 248 yield Paragraph.from_cbor(cbor.load(file))
249 except EOFError:
250 break

~/anaconda2/envs/py36/lib/python3.6/site-packages/trec_car/read_data.py in from_cbor(cbor)
171 @staticmethod
172 def from_cbor(cbor):
--> 173 assert cbor[0] == 0
174 paragraphId = cbor[1].decode('ascii')
175 return Paragraph(paragraphId, map(ParaBody.from_cbor, cbor[2]))

AssertionError:

Am I doing something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant