lt_go_emotions / README.md
SkyWater21's picture
Update README.md
515acc6
metadata
license: mit
dataset_info:
  config_name: google_translator
  features:
    - name: lt_text
      dtype: string
    - name: text
      dtype: string
    - name: labels
      sequence:
        class_label:
          names:
            '0': admiration
            '1': amusement
            '2': anger
            '3': annoyance
            '4': approval
            '5': caring
            '6': confusion
            '7': curiosity
            '8': desire
            '9': disappointment
            '10': disapproval
            '11': disgust
            '12': embarrassment
            '13': excitement
            '14': fear
            '15': gratitude
            '16': grief
            '17': joy
            '18': love
            '19': nervousness
            '20': optimism
            '21': pride
            '22': realization
            '23': relief
            '24': remorse
            '25': sadness
            '26': surprise
            '27': neutral
    - name: labels_ekman
      sequence:
        class_label:
          names:
            '0': anger
            '1': disgust
            '2': fear
            '3': joy
            '4': sadness
            '5': surprise
            '6': neutral
    - name: id
      dtype: string
  splits:
    - name: train
      num_bytes: 7095238
      num_examples: 43410
    - name: validation
      num_bytes: 885284
      num_examples: 5426
    - name: test
      num_bytes: 882333
      num_examples: 5427
  download_size: 6057071
  dataset_size: 8862855
configs:
  - config_name: google_translator
    data_files:
      - split: train
        path: google_translator/train-*
      - split: validation
        path: google_translator/validation-*
      - split: test
        path: google_translator/test-*
task_categories:
  - text-classification
language:
  - en
  - lt

Original dataset: GoEmotions dataset

The dataset was machine translated to Lithuanian using free Google Translate API.

Tool used for translation: deep-translator

Translation script:

from datasets import load_dataset
from deep_translator import GoogleTranslator
from deep_translator.exceptions import TranslationNotFound

original_dataset = load_dataset("go_emotions", name="simplified")
translator = GoogleTranslator(source="en", target="lt")

def translate_batch(batch):
    original_text = batch["text"]

    while True:
        try:
            translated_batch = translator.translate_batch(original_text)
            break
        except TranslationNotFound:
            # Translation can fail due to API limits, so we retry until it works
            print(f"Translation failed. Retrying...")
    
    # We fix untranslated entries (None values) by replacing them with the original text
    for i in range(len(translated_batch)):
        if not translated_batch[i]:
            translated_batch[i] = original_text[i]
            print(f"Replaced {original_text[i]} vs {translated_batch[i]}")
            
    batch["lt_text"] = translated_batch
    
    return batch

translated_dataset = original_dataset.map(
    translate_batch, batched=True, batch_size=500
)

Column labels contains multi-label emotion annotations with 28 emotion labels as per GoEmotion dataset:

0: admiration
1: amusement
2: anger
3: annoyance
4: approval
5: caring
6: confusion
7: curiosity
8: desire
9: disappointment
10: disapproval
11: disgust
12: embarrassment
13: excitement
14: fear
15: gratitude
16: grief
17: joy
18: love
19: nervousness
20: optimism
21: pride
22: realization
23: relief
24: remorse
25: sadness
26: surprise
27: neutral

Column labels_ekman contains multi-label emotion annotations with 7 base emotions as per Dr. Ekman theory:

0: anger
1: disgust
2: fear
3: joy
4: sadness
5: surprise
6: neutral

Label mapping from 28 emotions from GoEmotion to 7 base emotions as per Dr. Ekman theory:

GoEmotion Ekman
admiration joy
amusement joy
anger anger
annoyance anger
approval joy
caring joy
confusion surprise
curiosity surprise
desire joy
disappointment sadness
disapproval anger
disgust disgust
embarrassment sadness
excitement joy
fear fear
gratitude joy
grief sadness
joy joy
love joy
nervousness fear
optimism joy
pride joy
realization surprise
relief joy
remorse sadness
sadness sadness
surprise surprise
neutral neutral