dataset upload
Browse files- README.md +90 -0
- build_europarl_conversation.py +65 -0
- data/bg.jsonl +3 -0
- data/cs.jsonl +3 -0
- data/da.jsonl +3 -0
- data/de.jsonl +3 -0
- data/el.jsonl +3 -0
- data/en.jsonl +3 -0
- data/es.jsonl +3 -0
- data/et.jsonl +3 -0
- data/fi.jsonl +3 -0
- data/fr.jsonl +3 -0
- data/hu.jsonl +3 -0
- data/it.jsonl +3 -0
- data/lt.jsonl +3 -0
- data/lv.jsonl +3 -0
- data/nl.jsonl +3 -0
- data/pl.jsonl +3 -0
- data/pt.jsonl +3 -0
- data/ro.jsonl +3 -0
- data/sk.jsonl +3 -0
- data/sl.jsonl +3 -0
- data/sv.jsonl +3 -0
- waifu.png +3 -0
README.md
CHANGED
@@ -1,3 +1,93 @@
|
|
1 |
---
|
2 |
license: cc-by-sa-4.0
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: cc-by-sa-4.0
|
3 |
---
|
4 |
+
---
|
5 |
+
annotations_creators:
|
6 |
+
- no-annotation
|
7 |
+
language_creators:
|
8 |
+
- crowdsourced
|
9 |
+
license:
|
10 |
+
- cc-by-sa-4.0
|
11 |
+
task_categories:
|
12 |
+
- text-generation
|
13 |
+
- fill-mask
|
14 |
+
task_ids:
|
15 |
+
- language-modeling
|
16 |
+
- masked-language-modeling
|
17 |
+
source_datasets:
|
18 |
+
- original
|
19 |
+
language:
|
20 |
+
- en
|
21 |
+
|
22 |
+
configs:
|
23 |
+
- config_name: default
|
24 |
+
data_files:
|
25 |
+
- split: final
|
26 |
+
path: "data"
|
27 |
+
|
28 |
+
pretty_name: europarl-conversation
|
29 |
+
---
|
30 |
+
|
31 |
+
# Dataset Card for Europarl-Conversation
|
32 |
+
|
33 |
+
![](waifu.png "SD-Generated image styled in the same essence as europarl")
|
34 |
+
|
35 |
+
*Waifu to catch your attention.*
|
36 |
+
|
37 |
+
## Dataset Details
|
38 |
+
|
39 |
+
### Dataset Description
|
40 |
+
|
41 |
+
*europarl-conversation* is a formal conversational dataset built from europarl data.
|
42 |
+
|
43 |
+
- **Curated by:** M8than
|
44 |
+
- **Funded by [optional]:** Recursal.ai
|
45 |
+
- **Shared by [optional]:** M8than
|
46 |
+
- **Language(s) (NLP):** English instruct (but various languages in)
|
47 |
+
- **License:** cc-by-sa-4.0
|
48 |
+
|
49 |
+
### Dataset Sources [optional]
|
50 |
+
|
51 |
+
- **Source Data:** [https://www.statmt.org/europarl/](https://www.statmt.org/europarl/) (Transcript source)
|
52 |
+
|
53 |
+
### Processing and Filtering
|
54 |
+
|
55 |
+
```
|
56 |
+
Prerequisite:
|
57 |
+
Download the source dataset from [https://www.statmt.org/europarl/](https://www.statmt.org/europarl/).
|
58 |
+
```
|
59 |
+
|
60 |
+
The scripts in this repository were written to extract every conversation from the europarl transcripts.
|
61 |
+
It's as simple as extracting the dataset to an "/text" directory and running the script.
|
62 |
+
|
63 |
+
### Format
|
64 |
+
|
65 |
+
Dataset files are JSONL with each line representing one conversation. Each entry is keyed with the full text entry.
|
66 |
+
|
67 |
+
### Data Splits
|
68 |
+
|
69 |
+
- final
|
70 |
+
- Contains full conversations.
|
71 |
+
|
72 |
+
### Dataset Curators
|
73 |
+
|
74 |
+
M8than. (If something is wrong, `@m8than` on discord.)
|
75 |
+
|
76 |
+
### Licensing Information
|
77 |
+
|
78 |
+
This release contains content from europarl.
|
79 |
+
|
80 |
+
Recursal Waifus (The banner image) are licensed under CC-BY-SA.
|
81 |
+
They do not represent the related websites in any official capacity unless otherwise or announced by the website.
|
82 |
+
You may use them as a banner image. However, you must always link back to the dataset.
|
83 |
+
|
84 |
+
### Citation Information
|
85 |
+
|
86 |
+
```
|
87 |
+
@ONLINE{europarl-conversation,
|
88 |
+
title = {europarl-conversation},
|
89 |
+
author = {M8than, recursal.ai},
|
90 |
+
year = {2024},
|
91 |
+
howpublished = {\url{https://huggingface.co/datasets/recursal/europarl-conversation}},
|
92 |
+
}
|
93 |
+
```
|
build_europarl_conversation.py
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os, orjson
|
2 |
+
import re
|
3 |
+
|
4 |
+
cur_dir = os.path.dirname(os.path.abspath(__file__))
|
5 |
+
|
6 |
+
txt_dir = cur_dir + "/text"
|
7 |
+
|
8 |
+
# read folder names in /txt
|
9 |
+
categories = os.listdir(txt_dir)
|
10 |
+
|
11 |
+
def parse_speech(text):
|
12 |
+
# This pattern matches speaker tags and extracts ID and NAME attributes
|
13 |
+
speaker_pattern = re.compile(r'<SPEAKER ID=\"\d+\" NAME=\"(.*?)\"')
|
14 |
+
# Initialize variables
|
15 |
+
output = []
|
16 |
+
speaker_name = ""
|
17 |
+
|
18 |
+
for line in text.split('\n'):
|
19 |
+
# Check for speaker tag
|
20 |
+
if '<SPEAKER' in line:
|
21 |
+
# Extract speaker name
|
22 |
+
match = speaker_pattern.search(line)
|
23 |
+
if match:
|
24 |
+
speaker_name = match.group(1)
|
25 |
+
# Check for paragraph tag or chapter id tag and skip it
|
26 |
+
elif '<P>' in line or '<CHAPTER ID=' in line:
|
27 |
+
continue
|
28 |
+
# Process normal text lines
|
29 |
+
else:
|
30 |
+
# Append speaker name before the speech if it's not empty
|
31 |
+
if speaker_name:
|
32 |
+
formatted_line = f"\n{speaker_name}: {line}"
|
33 |
+
# Reset speaker name to avoid repeating it for subsequent lines of the same speaker
|
34 |
+
speaker_name = ""
|
35 |
+
else:
|
36 |
+
formatted_line = line
|
37 |
+
output.append(formatted_line)
|
38 |
+
|
39 |
+
return "\n".join(output)
|
40 |
+
|
41 |
+
for category in categories:
|
42 |
+
# list txt files in each folder
|
43 |
+
files = os.listdir(txt_dir + category)
|
44 |
+
|
45 |
+
jsonl_docs = []
|
46 |
+
for file in files:
|
47 |
+
# read each txt file
|
48 |
+
with open(txt_dir + category + "/" + file, "r") as f:
|
49 |
+
# try to read content
|
50 |
+
try:
|
51 |
+
content = f.read()
|
52 |
+
|
53 |
+
parsed_content = parse_speech(content)
|
54 |
+
|
55 |
+
jsonl_docs.append({"text": parsed_content, "lang": category})
|
56 |
+
except:
|
57 |
+
print("Error reading file:", file)
|
58 |
+
continue
|
59 |
+
|
60 |
+
# write to jsonl file in jsonl folder
|
61 |
+
with open(cur_dir + "/jsonl/" + category + ".jsonl", "wb") as f:
|
62 |
+
for doc in jsonl_docs:
|
63 |
+
f.write(orjson.dumps(doc) + b"\n")
|
64 |
+
|
65 |
+
|
data/bg.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ab6dfd7efd3fce184eb79b2f46348568c654c8748d5fc5d7a340a5329aa0488f
|
3 |
+
size 114236136
|
data/cs.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0b5054e617dc4ef0416fe619350ebc7a7dd289293375b82e69c36b97c3c04f4b
|
3 |
+
size 101557196
|
data/da.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:541029e3507c09069a356f8c46d1d96b86d72643f60ec94a342b80a91686f5ec
|
3 |
+
size 326169441
|
data/de.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:28bcd72c30900b5f93b78e81d4ba091c062af476d4f8f66a948bf734f7875d39
|
3 |
+
size 359182725
|
data/el.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1f161903c897a4fe8a9c4b986ef5df1195f3fc463a934c955f9c4fbeee2478bd
|
3 |
+
size 481807173
|
data/en.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8c12b1c5016ec53eead3425758ebbbfe2305491d6120802b04ffa0dccdb97cb8
|
3 |
+
size 334512223
|
data/es.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fa87bcba3fc1f36eec12f96e0b3d75e8643080eb4d0d1d393390f68e9d934d86
|
3 |
+
size 355900973
|
data/et.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1faa16a09bd2804e10c4af012352ecffb866a54abc7838990e8554a55755458f
|
3 |
+
size 94570070
|
data/fi.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3533d97eb848c8d9c751d55f2fb640082f9fb39bb80acbf1b7bcd95f8829b12f
|
3 |
+
size 326840056
|
data/fr.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e46059ca0ff7e7522ae50fadb874789a4eed411858b26f24f044f50b80b45aca
|
3 |
+
size 376958885
|
data/hu.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ab684240ac194aa5a7830ba0ec7d574940b6cdfde6f3ee9c58dc9859e05a3e34
|
3 |
+
size 108735203
|
data/it.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:998420c45d34eaa4c19b3b252df3acd38df109ea31c3983c8636406376dc9b6e
|
3 |
+
size 355739636
|
data/lt.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a6ca6e369e19ee2c1c719757a642302def7414ca8f59910e03829c414589032b
|
3 |
+
size 96091032
|
data/lv.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:58b136291c51fe7237e8bc5b8e518295b24d5b808cf1a13239e938976cd0cb45
|
3 |
+
size 99492055
|
data/nl.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ea21e8a1313f2d804c2f62d87ae578be1488dbad8a5ef8eabbce020e57e32c17
|
3 |
+
size 356726692
|
data/pl.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:53923f0c8d61e25f6b2e60967f18514c06beb953c7b6020cb53248fd26fcda07
|
3 |
+
size 104879090
|
data/pt.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:858b17b87ca662ff11965159f3467a97d5ace7cc595a4175cda2ea94db990ce3
|
3 |
+
size 359883805
|
data/ro.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6e5cffc7311102dc1bf3cda1e254c5290756ceadb6ecc8f9b0ee5ad3fd621cf7
|
3 |
+
size 67828401
|
data/sk.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b76d2cc208c54ce5bbd0cf053c4901622d0f194c77feeacb98efc7e79901b45d
|
3 |
+
size 100453491
|
data/sl.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7423283e434346bdeeedb972d084503c254b9e1642358f01b67e36241671d244
|
3 |
+
size 87983745
|
data/sv.jsonl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:33bec4cfa82c603a711a3127375c02256611c6f07ad357dc2980ff58740e01b6
|
3 |
+
size 324510843
|
waifu.png
ADDED
Git LFS Details
|