Comparable between languages

#21
by VityaVitalich - opened

Dear maintainers,

As i notice, ids between different languages are not consistent, therefore one id could serve for different words. Is there any way to match wiki articles by languages? or maybe there is existing corpora that has already done this?

I have encountered https://linguatools.org/tools/corpora/wikipedia-comparable-corpora/ , unfortunately all their xml files seem to be invalid

If you need the related articles in other languages, there is a Wikipedia API call you can make...

Here I'm calling just one title, you can pass multiple titles separated by commas to get more articles. There is probably a limit to the number of titles you can pass in with one query:

https://en.wikipedia.org/w/api.php?action=query&titles=Josephine_Baker&prop=langlinks&lllimit=max&format=json

The JSON response looks like:

{"batchcomplete":"","query":{"normalized":[{"from":"Josephine_Baker","to":"Josephine Baker"}],"pages":{"255083":{"pageid":255083,"ns":0,"title":"Josephine Baker","langlinks":[{"lang":"af","*":"Josephine Baker"},{"lang":"ar","*":"\u062c\u0648\u0632\u0641\u064a\u0646 \u0628\u064a\u0643\u0631"},{"lang":"arz","*":"\u062c\u0648\u0632\u0641\u064a\u0646 \u0628\u064a\u0643\u0631"},{"lang":"az","*":"Jozefina Beyker"},{"lang":"azb","*":"\u0698\u0648\u0632\u0641\u06cc\u0646 \u0628\u06cc\u06a9\u0631"},{"lang":"be","*":"\u0416\u0430\u0437\u0435\u0444\u0456\u043d\u0430 \u0411\u0435\u0439\u043a\u0435\u0440"},{"lang":"bg","*":"\u0414\u0436\u043e\u0437\u0435\u0444\u0438\u043d \u0411\u0435\u0439\u043a\u044a\u0440"},{"lang":"bn","*":"\u099c\u09cb\u09b8\u09c7\u09ab\u09bf\u09a8 \u09ac\u09c7\u0995\u09be\u09b0"},{"lang":"br","*":"Josephine Baker"},{"lang":"ca","*":"Jos\u00e9phine Baker"},{"lang":"cs","*":"Josephine Bakerov\u00e1"},{"lang":"cv","*":"\u0416\u043e\u0437\u0435\u0444\u0438\u043d\u0430 \u0411\u0435\u0439\u043a\u0435\u0440"},{"lang":"da","*":"Josephine Baker"},{"lang":"de","*":"Josephine Baker"},{"lang":"el","*":"\u0396\u03bf\u03b6\u03b5\u03c6\u03af\u03bd \u039c\u03c0\u03ad\u03b9\u03ba\u03b5\u03c1"},{"lang":"eo","*":"Josephine Baker"},{"lang":"es","*":"Jos\u00e9phine Baker"},{"lang":"et","*":"Jos\u00e9phine Baker"},{"lang":"eu","*":"Jos\u00e9phine Baker"},{"lang":"fa","*":"\u0698\u0648\u0632\u0641\u06cc\u0646 \u0628\u06cc\u06a9\u0631"},{"lang":"fi","*":"Jos\u00e9phine Baker"},{"lang":"fo","*":"Josephine Baker"},{"lang":"fr","*":"Jos\u00e9phine Baker"},{"lang":"frp","*":"Jos\u00e9phine Baker"},{"lang":"fy","*":"Josephine Baker"},{"lang":"ga","*":"Josephine Baker"},{"lang":"gl","*":"Josephine Baker"},{"lang":"he","*":"\u05d2'\u05d5\u05d6\u05e4\u05d9\u05df \u05d1\u05d9\u05d9\u05e7\u05e8"},{"lang":"hr","*":"Josephine Baker"},{"lang":"ht","*":"Jos\u00e9phine Baker"},{"lang":"hu","*":"Josephine Baker"},{"lang":"hy","*":"\u053a\u0578\u0566\u0565\u0586\u056b\u0576 \u0532\u0565\u0575\u0584\u0565\u0580"},{"lang":"id","*":"Josephine Baker"},{"lang":"io","*":"Josephine Baker"},{"lang":"is","*":"Josephine Baker"},{"lang":"it","*":"Jos\u00e9phine Baker"},{"lang":"ja","*":"\u30b8\u30e7\u30bb\u30d5\u30a3\u30f3\u30fb\u30d9\u30fc\u30ab\u30fc"},{"lang":"kk","*":"\u0414\u0436\u043e\u0437\u0435\u0444\u0438\u043d \u0411\u0435\u0439\u043a\u0435\u0440"},{"lang":"ko","*":"\uc870\uc138\ud540 \ubca0\uc774\ucee4"},{"lang":"ksh","*":"Josephine Baker"},{"lang":"ku","*":"Josephine Baker"},{"lang":"la","*":"Iosephina Baker"},{"lang":"lb","*":"Josephine Baker"},{"lang":"li","*":"Jos\u00e9phine Baker"},{"lang":"lmo","*":"Gi\u00fcsepina Baker"},{"lang":"lv","*":"D\u017eozef\u012bne Beikere"},{"lang":"ml","*":"\u0d1c\u0d4b\u0d38\u0d2b\u0d48\u0d7b \u0d2c\u0d47\u0d15\u0d4d\u0d15\u0d7c"},{"lang":"ms","*":"Josephine Baker"},{"lang":"nl","*":"Josephine Baker"},{"lang":"nn","*":"Jos\u00e9phine Baker"},{"lang":"nb","*":"Jos\u00e9phine Baker"},{"lang":"oc","*":"Josephine Baker"},{"lang":"pam","*":"Josephine Baker"},{"lang":"pl","*":"Josephine Baker"},{"lang":"pms","*":"Jos\u00e9phine Baker"},{"lang":"pt","*":"Josephine Baker"},{"lang":"ro","*":"Josephine Baker"},{"lang":"ru","*":"\u0411\u0435\u0439\u043a\u0435\u0440, \u0416\u043e\u0437\u0435\u0444\u0438\u043d\u0430"},{"lang":"sc","*":"Josephine Baker"},{"lang":"sco","*":"Josephine Baker"},{"lang":"sh","*":"Josephine Baker"},{"lang":"simple","*":"Josephine Baker"},{"lang":"sk","*":"Josephine Baker"},{"lang":"sr","*":"\u0416\u043e\u0437\u0435\u0444\u0438\u043d\u0430 \u0411\u0435\u043a\u0435\u0440"},{"lang":"sv","*":"Jos\u00e9phine Baker"},{"lang":"tr","*":"Josephine Baker"},{"lang":"uk","*":"\u0416\u043e\u0437\u0435\u0444\u0456\u043d\u0430 \u0411\u0435\u0439\u043a\u0435\u0440"},{"lang":"ur","*":"\u062c\u0648\u0632\u0641\u06cc\u0646 \u0628\u06cc\u06a9\u0631"},{"lang":"uz","*":"Josephine Baker"},{"lang":"vi","*":"Josephine Baker"},{"lang":"wuu","*":"\u7ea6\u745f\u82ac\u00b7\u8d1d\u514b"},{"lang":"yo","*":"Josephine Baker"},{"lang":"zh","*":"\u7d04\u745f\u82ac\u00b7\u8c9d\u514b"},{"lang":"zh-yue","*":"\u7d04\u745f\u82ac\u78a7\u5609"}]}}},"limits":{"langlinks":500}}

Note that article titles can be renamed, you can use the pageids parameter in the query string instead of the title.

Sign up or log in to comment