irshadbhat / csnlp

Neural Stacking Dependency Parsers for Code Switching texts
MIT License
8 stars 6 forks source link

Pre-trained Model for polyglot parsing #2

Open aayushkubb opened 4 years ago

aayushkubb commented 4 years ago

Hi I am trying to run the mono and polyglot parser, while the code works perfectly for the mono parsers, it breaks when I used the model for the polyglot parser, I tried using all the different polyglot parsers available but the code breaks at:

https://github.com/irshadbhat/csnlp/blob/master/polyglot_jm_parser.py#L78

Can anyone please share the requisite models for running polyglot model ?

irshadbhat commented 4 years ago

Can you share the full error traceback.

aayushkubb commented 4 years ago

Yeah,

python parser.py 
[dynet] random seed: 2909855673
[dynet] allocating memory: 512MB
[dynet] memory allocation done.
Traceback (most recent call last):
  File "parser.py", line 2, in <module>
    parser = Parser(model='/home/vz/ak47/csnlp/PTB/PARSER/en-ptb-parser')
  File "/home/vz/ak47/csnlp/snn_polyglot_jm_parser.py", line 91, in __init__
    self.ELOOKUP_WORD = self.model.add_lookup_parameters((self.meta.n_words_eng, self.meta.w_dim))
AttributeError: Meta instance has no attribute 'n_words_eng'
[dynet] random seed: 1589859874
[dynet] allocating memory: 512MB
[dynet] memory allocation done.
Traceback (most recent call last):
  File "parser.py", line 2, in <module>
    parser = Parser(model='/home/vz/ak47/csnlp/UD/EN/PARSER/en-ud-parser')
  File "/home/vz/ak47/csnlp/snn_polyglot_jm_parser.py", line 91, in __init__
    self.ELOOKUP_WORD = self.model.add_lookup_parameters((self.meta.n_words_eng, self.meta.w_dim))
AttributeError: Meta instance has no attribute 'n_words_eng'

I tried using all the available parsers. The main intent is to use the parser for multilingual texts,.

irshadbhat commented 4 years ago

You are trying to load a monolingual model in a multilingual setting. There are no pretrained models available for multilingual (or code switching) texts. You need to train your own models for multilingual data using polyglot_jm_parser.py and snn_polyglot_jm_parser.py. Description is in the README.

Mounika2405 commented 4 years ago

I am trying to run snn_polyglot_jm_parser.py using the base model returned by polyglot_parser.py but I'm facing the following issue.

Command Used: python3 snn_polyglot_jm_parser.py --ctrain csnlp-master/tweets_train.conll --cdev csnlp-master/tweets_dev.conll --trainer adam --bvec 1 --base-model csnlp-master/hi-en-parser1 --save-model /csnlp-master/hi-en-parserfinal

Screenshot 2020-01-19 at 2 19 55 PM