Aaditya-Singh / E2E-ECPE

Code for the WASSA 2021 paper (oral) "An End-to-End Network for Emotion-Cause Pair Extraction"
23 stars 7 forks source link

question about input text #3

Closed JH-lee95 closed 1 year ago

JH-lee95 commented 1 year ago

thank you for your nice work and dataset!

I have a question about the format of input text.

def load_w2v(embedding_dim, embedding_dim_pos, train_file_path, embedding_path):
    print('\nload embedding...')

    words = []
    inputFile1 = open(train_file_path, 'r')
    for line in inputFile1.readlines():
        line = line.strip().split(',')
        emotion, clause = line[2], line[-1] 
        words.extend(emotion.lower().split() + clause.lower().split())
        # words extended by ['happy','the','thief','was','caught']

    words = set(words) # Collection of all unique words
    word_idx = dict((c, k + 1) for k, c in enumerate(words)) # Each word and its position
    word_idx_rev = dict((k + 1, c) for k, c in enumerate(words)) # Each word and its position

in this code, you extract "emotion" (line[2]) as well as "clause" (line[-1]).

I think the variable "emotion" might be a crucial hint for the model to predict whether this clause is emotion clause or not, because if "emotion" is null that means this is not a emotion clause.

so what I want to ask is that, do you have some experimental results where "emotion" is not included in input text?

for example ['happy','the','thief','was','caught'] => ['the','thief','was','caught'] .

thank you again and have a nice day!

Aaditya-Singh commented 1 year ago

Hi Lee, thanks for your interest in our work. The load_w2v function only serves the purpose to map the word indices to their corresponding GloVe embeddings.

The input x to the model during training and inference comes via the load_data_pair. Inside this function, only clause words are used for constructing x.

P.S. I'd highly recommend using VSCode debugger which allows you to monitor the code flow in real time for queries such as this.

Hope this helps and have a nice day yourself!

JH-lee95 commented 1 year ago

oh i see. i missed load_data_pair. thank you for your kind reply!