ArchivesPortalEuropeFoundation / Topic-Detection

Using machine learning approaches for automatic topic detection in a multilingual environment
6 stars 0 forks source link

Bug when requesting Wikipedia redirects #60

Open kstamatis opened 2 years ago

kstamatis commented 2 years ago

@fedenanni I have noticed that when requesting information about the redirects in the Wikipedia API, the code does not take into consideration the possibility that there may be the case for redirects not to exist. For example: https://fr.wikipedia.org/w/api.php?action=query&titles=Napoleon&&redirects&format=json returns "redirects" key in the JSON response, while https://fr.wikipedia.org/w/api.php?action=query&titles=aust%C3%A9rit%C3%A9&redirects&format=json does not include "redirects".

File nlp.py and more specifically, the method: get_redirect needs to be fixed.

kstamatis commented 2 years ago

I have created the Pull Request https://github.com/ArchivesPortalEuropeFoundation/Topic-Detection/pull/61 that fixes the issue.

fedenanni commented 2 years ago

All looks good, thanks again!