ShannonAI / mrc-for-flat-nested-ner

Code for ACL 2020 paper `A Unified MRC Framework for Named Entity Recognition`
643 stars 117 forks source link

Cannot import TensorMetric #78

Closed smiles724 closed 3 years ago

smiles724 commented 3 years ago

Hi, I notice your past reply. However, my current version of lightning is 1.2.10, which is the latest. But I cannot import TensorMetric, can you please give me a solution? https://github.com/ShannonAI/mrc-for-flat-nested-ner/issues/54#issue-719107388

YuxianMeng commented 3 years ago

@Wufang1997 Hi, please use pytorch-lightning==0.9.0, which is listed in requirements.txt If you still wanna use latest pytorch-lightning, please refer to their latest documentation to implement metrics in a new way.

smiles724 commented 3 years ago

@Wufang1997 Hi, please use pytorch-lightning==0.9.0, which is listed in requirements.txt If you still wanna use latest pytorch-lightning, please refer to their latest documentation to implement metrics in a new way.

Thanks for your reply. By the way, can I ask the reason you choose pytorch-lightning as the base of your approach implementation? I used to adopt pytorch for most of my past projects and it is the first time to utilize pytorch-lightning. Can you give me some hints whether there are some advantages that lightning outweighs other packages? Thx.

YuxianMeng commented 3 years ago

@Wufang1997 Good question:) pl team make a thorough explanation on why pl: https://pytorch-lightning.readthedocs.io/en/latest/starter/introduction_guide.html#why-pytorch-lightning

smiles724 commented 3 years ago

Interesting. By the way, I am curious about how you preprocessed datasets like MSRA. I noticed that the raw MSRA dataset is in the form of '{phase}.tsv' and has already been splitter into train/dev/test. However, what I downloaded online took the form of 'txt' and only has train/test. Can you tell me where you obtain your MSRA dataset so that I can process it myself?