paranames / README.md
lbourdois's picture
Add language tag
0832d30 verified
|
raw
history blame
6.36 kB
---
language:
- multilingual
- aa
- ab
- abs
- ace
- ady
- aeb
- af
- agq
- ak
- aln
- als
- alt
- am
- ami
- an
- ang
- anp
- ar
- arc
- arn
- arq
- ary
- arz
- as
- ase
- ast
- atj
- av
- avk
- awa
- ay
- az
- ba
- bag
- ban
- bar
- bas
- bbc
- bcc
- bcl
- be
- bg
- bgn
- bh
- bho
- bi
- bjn
- bkm
- bm
- bn
- bo
- bpy
- bqi
- br
- brh
- bs
- btm
- bto
- bug
- bxr
- ca
- cbk
- cdo
- ce
- ceb
- ch
- cho
- chr
- chy
- ckb
- co
- cps
- cr
- crh
- cs
- csb
- cu
- cv
- cy
- da
- dag
- de
- din
- diq
- dsb
- dtp
- dty
- dv
- dz
- ee
- egl
- el
- eml
- en
- eo
- es
- et
- eu
- ext
- fa
- ff
- fi
- fit
- fj
- fkv
- fo
- fr
- frc
- frp
- frr
- fur
- fy
- ga
- gag
- gan
- gcr
- gd
- gl
- glk
- gn
- gom
- gor
- got
- grc
- gsw
- gu
- guc
- gur
- gv
- ha
- hak
- haw
- he
- hi
- hif
- hil
- ho
- hr
- hrx
- hsb
- ht
- hu
- hy
- hyw
- hz
- ia
- id
- ie
- ig
- ii
- ik
- ike
- ilo
- inh
- io
- is
- it
- iu
- ja
- jam
- jbo
- jut
- jv
- ka
- kaa
- kab
- kbd
- kbp
- kcg
- kea
- kg
- khw
- ki
- kiu
- kj
- kjp
- kk
- kl
- km
- kn
- ko
- koi
- kr
- krc
- kri
- krj
- krl
- ks
- ksh
- ku
- kum
- kv
- kw
- ky
- la
- lad
- lb
- lbe
- lez
- lfn
- lg
- li
- lij
- liv
- lki
- lld
- lmo
- ln
- lo
- loz
- lrc
- lt
- ltg
- lus
- luz
- lv
- lzh
- lzz
- mad
- mai
- map
- mcn
- mdf
- mg
- mh
- mhr
- mi
- min
- mk
- ml
- mn
- mni
- mnw
- mo
- mr
- mrj
- ms
- mt
- mus
- mwl
- my
- myv
- mzn
- na
- nah
- nan
- nap
- nb
- nds
- ne
- new
- ng
- nia
- niu
- nl
- nn
- no
- nod
- nov
- nqo
- nrm
- nso
- nv
- ny
- nys
- oc
- om
- or
- os
- ota
- pa
- pag
- pam
- pap
- pcd
- pdc
- pdt
- pfl
- pi
- pih
- pl
- pms
- pnb
- pnt
- prg
- ps
- pt
- pwn
- qu
- qug
- rgn
- rif
- rm
- rmc
- rmf
- rmy
- rn
- ro
- roa
- ru
- rue
- rup
- ruq
- rw
- rwr
- ryu
- sa
- sah
- sat
- sc
- scn
- sco
- sd
- sdc
- se
- sei
- ses
- sg
- sgs
- sh
- shi
- shn
- shy
- si
- sjd
- sje
- sju
- sk
- skr
- sl
- sli
- sm
- sma
- smj
- smn
- sms
- sn
- so
- sq
- sr
- srn
- srq
- ss
- st
- stq
- sty
- su
- sv
- sw
- szl
- szy
- ta
- tay
- tcy
- te
- tet
- tg
- th
- ti
- tk
- tl
- tly
- tn
- to
- tpi
- tr
- tru
- trv
- ts
- tt
- tum
- tw
- ty
- tyv
- tzm
- udm
- ug
- uk
- ur
- uz
- ve
- vec
- vep
- vi
- vls
- vmf
- vo
- vot
- vro
- wa
- war
- wls
- wo
- wuu
- xal
- xh
- xmf
- xsy
- yi
- yo
- yue
- zea
- zgh
- zh
- zu
---
<img src="data/paranames_banner.png"></img>
# ParaNames: A multilingual resource for parallel names
This repository contains releases for the ParaNames corpus, consisting of parallel names of over 12 million named entities in over 400 languages.
ParaNames was introduced in [Sälevä, J. and Lignos, C., 2022. ParaNames: A Massively Multilingual Entity Name Corpus. arXiv preprint arXiv:2202.14035](https://arxiv.org/abs/2202.14035).
Please cite as:
```
@article{saleva2022paranames,
title={ParaNames: A Massively Multilingual Entity Name Corpus},
author={S{\"a}lev{\"a}, Jonne and Lignos, Constantine},
journal={arXiv preprint arXiv:2202.14035},
year={2022}
}
```
See the [Releases page](https://github.com/bltlab/paranames/releases) for the downloadable release.
# Using the data release
## Release format
The corpus is released as a gzipped TSV file which is produced by the pipeline included in this repository.
## Release notes
### Repeated entities
In current releases, any entity that is associated with multiple named entity types (PER, LOC, ORG) in the Wikidata type hierarchy will appear multiple times in the output, once with each type. This affects less than 3% of the entities in the data.
If you want a unique set of entities, you should deduplicate the data using the `wikidata_id` field.
If you only want to use entities that are associated with a single named entity type, you should remove any `wikidata_id` that appears in multiple rows.
# Using the code
First, install the following non-Python dependencies:
- MongoDB
- [xsv](https://github.com/BurntSushi/xsv)
- ICU support for your computer (e.g. `libicu-dev`)
Next, install ParaNames and its Python dependencies by running `pip install -e .`.
It is recommended that you use a Conda environment for package management.
## Creating the ParaNames corpus
To create a corpus following our approach, follow the steps below:
1. Download the latest Wikidata dump from the [Wikimedia page](https://dumps.wikimedia.org/wikidatawiki/entities/) and extract it. Note that this may take up several TB of disk space.
2. Use `recipes/paranames_pipeline.sh` which ingests the Wikidata JSON to MongoDB and then dumps and postprocesses it to our final TSV resource.
The call to `recipes/paranames_pipeline.sh` works as follows:
```
recipes/paranames_pipeline.sh <path_to_extracted_json_dump> <output_folder> <n_workers>
```
Set the number of workers based on the number of CPUs your machine has.
By default, only 1 CPU is used.
The output folder will contain one subfolder per language, inside of which `paranames_<language_code>.tsv` can be found.
The entire resource is located in `<output_folder>/combined/paranames.tsv`.
### Notes
ParaNames offers several options for customization:
- If your MongoDB instance uses a non-standard port, you should change the value of [`mongodb_port`](https://github.com/bltlab/paranames/blob/main/recipes/paranames_pipeline.sh#L13) accordingly inside `paranames_pipeline.sh`.
- Setting [`should_collapse_languages=yes`](https://github.com/bltlab/paranames/blob/main/recipes/dump.sh#L17) will cause Wikimedia language codes to be "collapsed" to the top-level Wikimedia language code, i.e. `kk-cyrl` will be converted to `kk`, `en-ca` to `en` etc.
- Setting [`should_keep_intermediate_files=yes`](https://github.com/bltlab/paranames/blob/main/recipes/dump.sh#L18) will cause intermediate files to be deleted. This includes the raw per-type TSV dumps (`{PER,LOC,ORG}.tsv`) from MongoDB, as well as outputs of `postprocess.py`.
- Within [`recipes/dump.sh`](https://github.com/bltlab/paranames/blob/main/recipes/dump.sh), it is also possible to define languages to be excluded and whether entity types should be disambiguated. By default, no languages are excluded and no disambiguation is done.
- After the pipeline completes, `<output_folder>` will contain one folder per language, inside of which is a TSV file containing the subset of names in that language. Combined TSVs with names in all languages are available in the `combined` folder.