You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You're looping over a collection proced
For every entry you create a country matrix. Ok.
Which you append to a list. Why?
Then you loop over that list, FOR EVERY loc in proced, but you only use the last iteration of that loop to write it back to loc
Furthermore when spacy found a location which is not in geonames then i['matrix'] is an empty list and self.country_model.predict(i['matrix']) throws a ValueError. It might be wiser to test feat if it contains values before calling predict.
The text was updated successfully, but these errors were encountered:
ac74475
added a commit
to ac74475/mordecai
that referenced
this issue
Sep 17, 2021
Updated the infer_country method to reduce the computational complexity and therefore improve the performance, this was also identified in openeventdata#84
Sorry, I really do not understand this code:
mordecai/mordecai/geoparse.py
Lines 716 to 738 in 05fa31d
You're looping over a collection
proced
For every entry you create a country matrix. Ok.
Which you append to a list. Why?
Then you loop over that list, FOR EVERY loc in proced, but you only use the last iteration of that loop to write it back to
loc
Furthermore when spacy found a location which is not in geonames then
i['matrix']
is an empty list andself.country_model.predict(i['matrix'])
throws a ValueError. It might be wiser to testfeat
if it contains values before calling predict.The text was updated successfully, but these errors were encountered: