Tom9358 commited on
Commit
5518ce0
·
verified ·
1 Parent(s): 81ef922

Upload Tatoeba data, 21 december 2024 version

Browse files

I would recommend anyone to download the most recent version of the files directly from Tatoeba.
Since the most recent version of the dataset on huggingface is already quite old, I uploaded today's versions of the Tatoeba sentences. I uploaded the full dataset, as well as some files for some individual languages that I happen to speak. Honorable mention to Gronings, language code gos.

Example code to download the most recent version of the Tatoeba dataset:
```
import requests

with open("downloadlinks.txt") as file:
for link in file:
link = link.strip()
if link:
response = requests.get(link)
open(link.split("/")[-1], "wb").write(response.content)
```
Where `downloadlinks.txt` could contain something like:
```
https://downloads.tatoeba.org/exports/links.tar.bz2
https://downloads.tatoeba.org/exports/per_language/eng/eng_sentences.tsv.bz2
https://downloads.tatoeba.org/exports/per_language/gos/gos_sentences.tsv.bz2
https://downloads.tatoeba.org/exports/per_language/nld/nld_sentences.tsv.bz2
https://downloads.tatoeba.org/exports/sentences_detailed.tar.bz2
https://downloads.tatoeba.org/exports/sentences.tar.bz2
```
Here's some more code to help you get started, linking the sentences. Assuming you've downloaded the files:
```
import pandas as pd
lang1 = "eng"
lang2 = "gos"

lang1_sentences = pd.read_csv(f"{lang1}_sentences.tsv.bz2", sep="\t", header=None, names=["id", "language", lang1])
lang2_sentences = pd.read_csv(f"{lang2}_sentences.tsv.bz2", sep="\t", header=None, names=["id", "language", lang2])
link_sentences = pd.read_csv("links.tar.bz2", sep="\t", header=None, names=["origin", "translation"])

df_parallel = link_sentences.merge(lang1_sentences, left_on="origin", right_on="id").merge(lang2_sentences, left_on="translation", right_on="id")[["origin", "translation", lang1, lang2]]
print(df_parallel)
```

deu_sentences.tsv.bz2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db8c4515d637f223010c99c5acfeeb3f70926382e9a12e535229ab0a0bd17d35
3
+ size 10961443
eng_sentences.tsv.bz2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11c1355898f6991166ddef1546fa8901d0175b29679b30feee80d4fea3bed2d6
3
+ size 23582873
gos_sentences.tsv.bz2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24abec9292f5a681aa0aebc945b583b9a3a96c2fae45769d51d07372c62888f3
3
+ size 93435
links.tar.bz2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3e0511b34fd6fd39592d54eddbbb0687534ab2d378ae1c6be1d428cdaca9842
3
+ size 134416101
nld_sentences.tsv.bz2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ca9a510600d0c777993f71d9d026d71288b0eec21792293d7609ebf0e32ba81
3
+ size 2316351
sentences.tar.bz2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b9702e8d50c14faa5f76736ecbc821b866dcf41e06fe8fe0d3cfff0e836b46d0
3
+ size 198278062
sentences_detailed.tar.bz2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2ec74e508f9c22ad99cc28e550a92fd277276ba4f7eb2f42fcea81ace219a0c9
3
+ size 274920195
spa_sentences.tsv.bz2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a7d7c411a9b529f071db5140b256a03077cb8fb829601a01bbe4cd43d6dca957
3
+ size 5798074