SteveKommrusch / OpenNMT-py-ggnn-example

Training, validation, and test files for GGNN encoder option in OpenNMT-py.
10 stars 4 forks source link

How to use the multi-dimensional node features #2

Closed seekamoon closed 4 years ago

seekamoon commented 4 years ago

Hello, thank you for doing such a good work.

After read the docs(https://opennmt.net/OpenNMT-py/ggnn.html#graph-data-format), I still have a question.

The nodes in the docs have single dimensional features Sentence tokens Feature values Edges --------------- ------------------ ------------------------------------------------------- - - - 0 a a b b <EOT> 0 1 2 3 4 4 2 3 12 <EOT> 0 2 1 3 2 4 , 0 6 1 7 2 5 , 0 4 , 0 5 , , , , 8 0 , 8 1

the first 0 is the feature of the first node -, the second 1 is the feature of the second node -......

I wonder that, if the nodes have multi-dimensional features,

for example, there are two nodes a and b, the feature vector of a is [1,2,3], and the feature vector of b is [4,5,6].

How to set the field of feature values ?

Looking forward to your answer, thank you!

SteveKommrusch commented 4 years ago

SeekaMoon,

I see there is a typo in the document, but multiple features per node can be provided using ‘,’ to add new dimensions between the tokens. For example, Sentence tokens Feature values Edges


Regards, Steve

From: SeekaMoon Sent: Tuesday, June 30, 2020 2:47 AM To: SteveKommrusch/OpenNMT-py-ggnn-example Cc: Subscribed Subject: [SteveKommrusch/OpenNMT-py-ggnn-example] How to use themulti-dimensional node features (#2)

Hello, thank you for doing such a good work. After read the docs(https://opennmt.net/OpenNMT-py/ggnn.html#graph-data-format), I still have a question. The nodes in the docs have single dimensional features Sentence tokens Feature values Edges


seekamoon commented 4 years ago

Thanks for your prompt reply, I have got it.