huggingface / hmtl

🌊HMTL: Hierarchical Multi-Task Learning - A State-of-the-Art neural network model for several NLP tasks based on PyTorch and AllenNLP
MIT License
1.19k stars 145 forks source link

NER and RE only #12

Closed Mahmedturk closed 5 years ago

Mahmedturk commented 5 years ago

Hi,

I want to experiment with this architecture for NER and RE only. What changes do I need to make?

VictorSanh commented 5 years ago

Hi @Mahmedturk , If you want to experiment with only two tasks (NER and RE), the fastest way (and the easiest way) would be to modify the training configuration file (https://github.com/huggingface/hmtl/blob/master/configs/emd_relation.json) and make sure that the EMD task is replaced by NER. Victor

VictorSanh commented 5 years ago

Closing it since there doesn't seem to be any activity. Feel free to re-open it if necessary! Victor

syramarshall commented 5 years ago

Hi there - I'm trying to do the same thing and so followed your advice. I also changed the model type to ner_relation but hit the following error "ner_relation not in acceptable choices for model.type: ['bcn', 'constituency_parser', 'biaffine_parser', 'coref', 'crf_tagger', 'decomposable_attention', 'event2mind', 'simple_seq2seq', 'bidaf', 'bidaf-ensemble', 'dialog_qa', 'nlvr_coverage_parser', 'nlvr_direct_parser', 'quarel_parser', 'wikitables_mml_parser', 'wikitables_erm_parser', 'atis_parser', 'srl', 'simple_tagger', 'esim', 'bimpm', 'graph_parser', 'relation_extractor', 'ner', 'relation', 'coref_custom', 'ner_emd', 'emd_relation', 'emd_coref', 'ner_emd_coref', 'ner_emd_relation', 'hmtl']" - I've just kicked off my training again using "emd_relation" in the hope that magically works, but if not do you have any suggestions?

VictorSanh commented 5 years ago

Hey @syramarshall Yes, you should keep "type": "emd_relation" in the training config file. It just means that the EMD layer will be composed of a BiLSTM+CRF, but it is agnostic to whether you are actually doing MD with this layer. So just change the data in data_params for your NER dataset and the other model hyper-parameters if you need. Victor