-
Notifications
You must be signed in to change notification settings - Fork 52
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
Cryptical error msg for duplicates in entities #135
Comments
I forgot to mention that the code executes flawlessly with the original entities from However, in my example with custom entities, if I use a subset of the custom
To recap:
Does anybody know what's going on here? |
I don't have much bandwidth to look at this atm. But does padding the list with some dummy entities fix the issue? Do your entities occur in the KG? Shouldn't it be |
Hi Gilles, Thanks for your reply. The problem was simply that there were duplicates in the |
Ok thanks for the update! I will re-open the issue however as that is something we could detect for users and raise a more clear error! |
Hi! Any updates on this subject? I am running into similar issues. The relevant portion of the my code is as follows:
Note that the This piece of code produces the following error:
The initialization of the RDF2Vec transformer is done using:
At this point, I'm not sure where to look for a potential cause for this error. Note that when the RandomWalker is initialized with Any suggestions are welcome! |
🐛 Bug
When trying to create embeddings for a custom list of DBPedia entities using
RDF2VecTransformer.fit_transform
, I'm encountering the following bug inRDF2VecTransformer._update
:Part 1:
File "/r2venv/lib/python3.9/site-packages/pyrdf2vec/rdf2vec.py", line 271, in _update
attr[pos] = tmp.pop(self._pos_walks[i]) IndexError: list assignment index out of range
Because
attr[pos] = tmp.pop(self._pos_walks[i]
tries to assign a value to an empty list,attr
, at indexpos
, I tried changing it toattr.insert(pos, tmp.pop(self._pos_walks[i]))
. This populates theattrs
list but then I run into another error:Part 2:
File "/r2venv/lib/python3.9/site-packages/pyrdf2vec/rdf2vec.py", line 271, in _update
tmp.pop(self._pos_walks[i]) IndexError: pop index out of range
This happens because
tmp
is a list of length 24, andself._pos_walks[i]
is 25. The for loop in line 271 iterates through the first elements ofself._pos_walks
(6 in my case, all with values lower than 24) and populatesattr
, but fails to continue because it reaches the nonexistent pop indexself._pos_walks[i] = 25
.Steps to Reproduce
entities
infit_transform(kg, entities)
inpyrdf2vec/examples/countries.py
. I used a list of 31 entities as a test case.Environment
Thanks for looking into it!
The text was updated successfully, but these errors were encountered: