Datasets:
Upload folder using huggingface_hub
Browse files- .DS_Store +0 -0
- ._.DS_Store +0 -0
- ._multiclass_dev_stratified.tsv +0 -0
- ._multiclass_test_stratified.tsv +0 -0
- ._multiclass_train_stratified.tsv +0 -0
- ._multilabel_dev_cleaned.tsv +0 -0
- ._multilabel_test_cleaned.tsv +0 -0
- ._multilabel_train_cleaned.tsv +0 -0
- ._prep_labels.py +0 -0
- .gitattributes +26 -0
- _del/._multiclass_dev_stratified.tsv +0 -0
- _del/._multiclass_test_stratified.tsv +0 -0
- _del/._multiclass_train_stratified.tsv +0 -0
- _del/._multilabel_dev_cleaned.tsv +0 -0
- _del/._multilabel_test_cleaned.tsv +0 -0
- _del/._multilabel_train_cleaned.tsv +0 -0
- _del/dev.tsv +3 -0
- _del/multiclass_dev_stratified.tsv +0 -0
- _del/multiclass_test_stratified.tsv +0 -0
- _del/multiclass_train_stratified.tsv +3 -0
- _del/multilabel_dev.tsv +3 -0
- _del/multilabel_dev_cleaned.tsv +3 -0
- _del/multilabel_test.tsv +3 -0
- _del/multilabel_test_cleaned.tsv +3 -0
- _del/multilabel_train.tsv +3 -0
- _del/multilabel_train_cleaned.tsv +3 -0
- _del/test.tsv +3 -0
- _del/train.tsv +3 -0
- multiclass_dev.tsv +3 -0
- multiclass_dev_stratified.tsv +0 -0
- multiclass_test.tsv +3 -0
- multiclass_test_stratified.tsv +0 -0
- multiclass_train.tsv +3 -0
- multiclass_train_stratified.tsv +3 -0
- multilabel_dev.tsv +3 -0
- multilabel_dev_cleaned.tsv +3 -0
- multilabel_test.tsv +3 -0
- multilabel_test_cleaned.tsv +3 -0
- multilabel_train.tsv +3 -0
- multilabel_train_cleaned.tsv +3 -0
- org files/.DS_Store +0 -0
- org files/._.DS_Store +0 -0
- org files/cleaned_dev.tsv +3 -0
- org files/cleaned_test.tsv +3 -0
- org files/cleaned_train.tsv +3 -0
- org files/dev.tsv +3 -0
- org files/test.tsv +3 -0
- org files/train.tsv +3 -0
- prep_labels.py +71 -0
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
._.DS_Store
ADDED
|
Binary file (4.1 kB). View file
|
|
|
._multiclass_dev_stratified.tsv
ADDED
|
Binary file (4.1 kB). View file
|
|
|
._multiclass_test_stratified.tsv
ADDED
|
Binary file (4.1 kB). View file
|
|
|
._multiclass_train_stratified.tsv
ADDED
|
Binary file (4.1 kB). View file
|
|
|
._multilabel_dev_cleaned.tsv
ADDED
|
Binary file (4.1 kB). View file
|
|
|
._multilabel_test_cleaned.tsv
ADDED
|
Binary file (4.1 kB). View file
|
|
|
._multilabel_train_cleaned.tsv
ADDED
|
Binary file (4.1 kB). View file
|
|
|
._prep_labels.py
ADDED
|
Binary file (4.1 kB). View file
|
|
|
.gitattributes
CHANGED
|
@@ -57,3 +57,29 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 57 |
# Video files - compressed
|
| 58 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 59 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
# Video files - compressed
|
| 58 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 59 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
_del/dev.tsv filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
_del/multiclass_train_stratified.tsv filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
_del/multilabel_dev.tsv filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
_del/multilabel_dev_cleaned.tsv filter=lfs diff=lfs merge=lfs -text
|
| 64 |
+
_del/multilabel_test.tsv filter=lfs diff=lfs merge=lfs -text
|
| 65 |
+
_del/multilabel_test_cleaned.tsv filter=lfs diff=lfs merge=lfs -text
|
| 66 |
+
_del/multilabel_train.tsv filter=lfs diff=lfs merge=lfs -text
|
| 67 |
+
_del/multilabel_train_cleaned.tsv filter=lfs diff=lfs merge=lfs -text
|
| 68 |
+
_del/test.tsv filter=lfs diff=lfs merge=lfs -text
|
| 69 |
+
_del/train.tsv filter=lfs diff=lfs merge=lfs -text
|
| 70 |
+
multiclass_dev.tsv filter=lfs diff=lfs merge=lfs -text
|
| 71 |
+
multiclass_test.tsv filter=lfs diff=lfs merge=lfs -text
|
| 72 |
+
multiclass_train.tsv filter=lfs diff=lfs merge=lfs -text
|
| 73 |
+
multiclass_train_stratified.tsv filter=lfs diff=lfs merge=lfs -text
|
| 74 |
+
multilabel_dev.tsv filter=lfs diff=lfs merge=lfs -text
|
| 75 |
+
multilabel_dev_cleaned.tsv filter=lfs diff=lfs merge=lfs -text
|
| 76 |
+
multilabel_test.tsv filter=lfs diff=lfs merge=lfs -text
|
| 77 |
+
multilabel_test_cleaned.tsv filter=lfs diff=lfs merge=lfs -text
|
| 78 |
+
multilabel_train.tsv filter=lfs diff=lfs merge=lfs -text
|
| 79 |
+
multilabel_train_cleaned.tsv filter=lfs diff=lfs merge=lfs -text
|
| 80 |
+
org[[:space:]]files/cleaned_dev.tsv filter=lfs diff=lfs merge=lfs -text
|
| 81 |
+
org[[:space:]]files/cleaned_test.tsv filter=lfs diff=lfs merge=lfs -text
|
| 82 |
+
org[[:space:]]files/cleaned_train.tsv filter=lfs diff=lfs merge=lfs -text
|
| 83 |
+
org[[:space:]]files/dev.tsv filter=lfs diff=lfs merge=lfs -text
|
| 84 |
+
org[[:space:]]files/test.tsv filter=lfs diff=lfs merge=lfs -text
|
| 85 |
+
org[[:space:]]files/train.tsv filter=lfs diff=lfs merge=lfs -text
|
_del/._multiclass_dev_stratified.tsv
ADDED
|
Binary file (4.1 kB). View file
|
|
|
_del/._multiclass_test_stratified.tsv
ADDED
|
Binary file (4.1 kB). View file
|
|
|
_del/._multiclass_train_stratified.tsv
ADDED
|
Binary file (4.1 kB). View file
|
|
|
_del/._multilabel_dev_cleaned.tsv
ADDED
|
Binary file (4.1 kB). View file
|
|
|
_del/._multilabel_test_cleaned.tsv
ADDED
|
Binary file (4.1 kB). View file
|
|
|
_del/._multilabel_train_cleaned.tsv
ADDED
|
Binary file (4.1 kB). View file
|
|
|
_del/dev.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4a8f3aeb8a690b5519f610ad4c76845338be4afca34a4e545fcb4ec4493a5e55
|
| 3 |
+
size 35149152
|
_del/multiclass_dev_stratified.tsv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
_del/multiclass_test_stratified.tsv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
_del/multiclass_train_stratified.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c8256b35b29cf051d5a9321b9aeb66c720c9a65ce604e91075de14395734a018
|
| 3 |
+
size 38756841
|
_del/multilabel_dev.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:85343f81f71b785e173cd022ff0bbabd2f1a124731d9b32a2ec54662f7f893ac
|
| 3 |
+
size 35280949
|
_del/multilabel_dev_cleaned.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:58baab57a6169363ae6e83ae5e13d97a5d5bcef036f6baacc622a2da9aa915d5
|
| 3 |
+
size 30422100
|
_del/multilabel_test.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:825cdea20c805a8943f252c3e6e748b333cdc0321d25c072aed33a360322f9ac
|
| 3 |
+
size 68515363
|
_del/multilabel_test_cleaned.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:410fb3fdbc348aeba1ff8374d1b37c6e844569c44cb3e65018ad473519c381ea
|
| 3 |
+
size 59705780
|
_del/multilabel_train.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:087f453ec8698af11ca77f7695ffcb2d2da6d681dcf81ab8e7065803b451452d
|
| 3 |
+
size 245123350
|
_del/multilabel_train_cleaned.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cfd1d86822dba30fab6142d63601bf463b885b61ae8ccc6f94e2b81a65c81a2c
|
| 3 |
+
size 211840972
|
_del/test.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f06d0ad21927c945dc825c5c86d5f313083998339f7459ef4b66201c0399f29d
|
| 3 |
+
size 68253039
|
_del/train.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:42b450f362151d45cb4f1bf9ab7f0bddbfcdd6d39628b03e667f79b7ec5698fb
|
| 3 |
+
size 244199378
|
multiclass_dev.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4cc57a4700a4e466ae42ffab6bc808ee71fcda87a8fb589b662c818bc9d70b0a
|
| 3 |
+
size 35231564
|
multiclass_dev_stratified.tsv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
multiclass_test.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2e19c27657fabd8e07a687a1ad210c5c10e95741f134a24a59756de810fbf04
|
| 3 |
+
size 68416652
|
multiclass_test_stratified.tsv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
multiclass_train.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9cdd59de403755c1670fb1377152f5d25d2467bd4c44e8cfd5ff8f81ac430f30
|
| 3 |
+
size 244777904
|
multiclass_train_stratified.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b60cd8781ffd8e86608540d7a68fb5946f7b7a0d37f5c554c067bdfd14f70a43
|
| 3 |
+
size 38674717
|
multilabel_dev.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0c32253a541ac65f0dd6435bea4f4ff7404ecb6292c33504e368b8a9d29aca0b
|
| 3 |
+
size 35318468
|
multilabel_dev_cleaned.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a2d1342d8596928e603b6c85b1c4807c2ac4e7703d5fa1ba96f25381ae3de31d
|
| 3 |
+
size 30434462
|
multilabel_test.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d4162f7d5b031c3db29685592498d6847758c8e9ac4f69e281e7207e36b23796
|
| 3 |
+
size 68590373
|
multilabel_test_cleaned.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d48646591cd7c8d5c0da608a132b549b042343540308467f8e79ee4abb9c0b84
|
| 3 |
+
size 59730504
|
multilabel_train.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5c8381656fed480a1494dc3071e1748b5ccd5e1bd909615a146e9894f2c5591a
|
| 3 |
+
size 245385761
|
multilabel_train_cleaned.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5801011ec8bbdc549f8de4c874b2c5fc4b3911a1104dcc030a464f2761405c7f
|
| 3 |
+
size 211927555
|
org files/.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
org files/._.DS_Store
ADDED
|
Binary file (4.1 kB). View file
|
|
|
org files/cleaned_dev.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6c2489884690c6efb7768051c2c509a12e32f763ecd776aeae2fd09908c57087
|
| 3 |
+
size 35149157
|
org files/cleaned_test.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0c99ded2b2e91133d297be0915c3952e0e99e63437b30a1e65816c517fec24b6
|
| 3 |
+
size 68252972
|
org files/cleaned_train.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7805ee4fa31960c1b43c76fcbcebb98cb070e5061c2e53ef561059a3a243ffd5
|
| 3 |
+
size 244199254
|
org files/dev.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:111d167921bd50ff80548105573569b036f74dc7a66485df7d29ff3aa3ee261e
|
| 3 |
+
size 35149175
|
org files/test.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:93a0745407ef5abce6e3abfc2c69864d477131ed9654e80b80d97375702bae3c
|
| 3 |
+
size 68253062
|
org files/train.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6f442234dccdb696960d10ed08c0d1fcac867dce909e2d512e88643bd3e91535
|
| 3 |
+
size 244199401
|
prep_labels.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import argparse
|
| 3 |
+
|
| 4 |
+
def process_to_multiclass(file_path):
|
| 5 |
+
# Load the TSV file into a pandas DataFrame, treating "NA" as a valid string
|
| 6 |
+
df = pd.read_csv(file_path, sep='\t', keep_default_na=False)
|
| 7 |
+
|
| 8 |
+
# Rename the 'label' column to 'register'
|
| 9 |
+
if 'label' in df.columns:
|
| 10 |
+
df.rename(columns={'label': 'register'}, inplace=True)
|
| 11 |
+
|
| 12 |
+
# Define the allowed register labels
|
| 13 |
+
allowed_labels = {"IN", "OP", "NA", "IP", "ID", "HI", "LY", "SP", "OTHER"}
|
| 14 |
+
|
| 15 |
+
# Create the new 'label' column by filtering the allowed labels from the 'register' column
|
| 16 |
+
def extract_labels(register_value, index):
|
| 17 |
+
if pd.isna(register_value) or register_value == "":
|
| 18 |
+
print(f"Problematic row {index}: Missing 'register' value")
|
| 19 |
+
return "" # Return an empty string or handle missing data as desired
|
| 20 |
+
try:
|
| 21 |
+
return ' '.join([label for label in register_value.split() if label in allowed_labels])
|
| 22 |
+
except Exception as e:
|
| 23 |
+
print(f"Problematic row {index}: {register_value} caused error: {e}")
|
| 24 |
+
return "" # Handle invalid data gracefully
|
| 25 |
+
|
| 26 |
+
# Apply the extraction function with index tracking for debugging
|
| 27 |
+
df['label'] = df.apply(lambda row: extract_labels(row['register'], row.name), axis=1)
|
| 28 |
+
|
| 29 |
+
# Save the DataFrame back to a TSV file (overwrites the original)
|
| 30 |
+
output_file = 'output_' + file_path
|
| 31 |
+
df.to_csv(output_file, sep='\t', index=False)
|
| 32 |
+
print(f"File processed successfully. Output saved to {output_file}")
|
| 33 |
+
|
| 34 |
+
def process_to_multilabel(file_path):
|
| 35 |
+
# Load the TSV file into a pandas DataFrame, treating "NA" as a valid string
|
| 36 |
+
df = pd.read_csv(file_path, sep='\t', keep_default_na=False)
|
| 37 |
+
|
| 38 |
+
# Rename the 'label' column to 'register'
|
| 39 |
+
if 'label' in df.columns:
|
| 40 |
+
df.rename(columns={'label': 'register'}, inplace=True)
|
| 41 |
+
|
| 42 |
+
# Create the new 'label' column by ws splitting the 'register' column and saving a list
|
| 43 |
+
def extract_labels(register_value, index):
|
| 44 |
+
try:
|
| 45 |
+
return register_value.split()
|
| 46 |
+
except Exception as e:
|
| 47 |
+
print(f"Problematic row {index}: {register_value} caused error: {e}")
|
| 48 |
+
return ""
|
| 49 |
+
|
| 50 |
+
# Apply the extraction function with index tracking for debugging
|
| 51 |
+
df['full_label'] = df.apply(lambda row: extract_labels(row['register'], row.name), axis=1)
|
| 52 |
+
|
| 53 |
+
# only keep major labels for the 'label' column
|
| 54 |
+
allowed_labels = {"IN", "OP", "NA", "IP", "ID", "HI", "LY", "SP", "OTHER"}
|
| 55 |
+
df['label'] = df['full_label'].apply(lambda x: [label for label in x if label in allowed_labels])
|
| 56 |
+
|
| 57 |
+
# Save the DataFrame back to a TSV file
|
| 58 |
+
output_file = 'output_' + file_path
|
| 59 |
+
df.to_csv(output_file, sep='\t', index=False)
|
| 60 |
+
print(f"File processed successfully. Output saved to {output_file}")
|
| 61 |
+
|
| 62 |
+
if __name__ == "__main__":
|
| 63 |
+
# Set up argument parser to take file name from the command line
|
| 64 |
+
parser = argparse.ArgumentParser(description="Process a TSV file by renaming the label column and filtering register labels.")
|
| 65 |
+
parser.add_argument('file_path', type=str, help="The path to the input TSV file")
|
| 66 |
+
|
| 67 |
+
# Parse the arguments
|
| 68 |
+
args = parser.parse_args()
|
| 69 |
+
|
| 70 |
+
# Call the function with the provided file path
|
| 71 |
+
process_to_multilabel(args.file_path)
|