Solution: don't use a set in order to remove duplications in the array of categories. Duplications appears because primary category is repeated in the secondary categories list. l Instead of using set (which is unsorted), manually check for duplication and remove the element from the list using pop.
Fix arxiv categories order as it is in the original XML document. Current situation:
API to find categories: https://export.arxiv.org/api/query?search_query=id:{id_of_arxiv_eprints}
Solution: don't use a set in order to remove duplications in the array of categories. Duplications appears because primary category is repeated in the secondary categories list. l Instead of using set (which is unsorted), manually check for duplication and remove the element from the list using pop.