nyu-mll / spinn

NYU ML² work on sentence encoding with tree structure and dynamic graphs
MIT License
108 stars 38 forks source link

Purpose of '(' and ')' parentheses in ListOps #100

Closed adamsolomou closed 3 years ago

adamsolomou commented 3 years ago

Hi,

I would like to clarify what is the purpose of the parentheses of type '(' and ')' in the ListOps dataset.

In my understanding the order in which the operators are nested is already encapsulated by the brackets of type '[' and ']', so why are the parentheses '(' and ')' needed? Am I missing something?

Thanks!

sleepinyourhat commented 3 years ago

If you're using a typical model like an RNN or Transformer, you should drop the round parens. The round parens are meant to define an exact binary tree for use in binary TreeRNN-style models, like we use in the paper. They can be deterministically derived from the square brackets (using a tiebreaking rule to binarize), but we encode it explicitly to minimize the risk that that goes wrong and provide compatibility with code that handles natural language sentence parses.

adamsolomou commented 3 years ago

Thanks for clarifying! I am using a Transformer-based model, so in that case I also agree that the round parens should not play any role. I am closing the issue.