allenai / allennlp

An open-source NLP research library, built on PyTorch.
http://www.allennlp.org
Apache License 2.0
11.71k stars 2.24k forks source link

TextField and Indexer for nested label #5688

Closed rollben closed 1 year ago

rollben commented 1 year ago

Hi I want to use allennlp's TextField or SequenceLabelField to realize a list of nest labels, e.g. [[apple notebook], [pear], ...[people square], [ great wall], [movie]] , I want to the label to indexed as a whole meanwhile keep its meaningful , for instance , apple notebook, I hope it can be have a individual number index to represent "apple notebook" instead of "apple_notebook" or "B-apple_notebook" or something else, and also let the token id of "apple notebook" could be input the encoder and obtained contextual meaning embedding vector. So how could I realize it through allennlp's Field, thanks!

github-actions[bot] commented 1 year ago

This issue is being closed due to lack of activity. If you think it still needs to be addressed, please comment on this thread 👇