Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is word level bi-lstm reflected in the code ? #58

Open
unktkn opened this issue Dec 30, 2018 · 1 comment
Open

Is word level bi-lstm reflected in the code ? #58

unktkn opened this issue Dec 30, 2018 · 1 comment

Comments

@unktkn
Copy link

unktkn commented Dec 30, 2018

Hi there,

Excuse the naiveness, I am having a bit of trouble understanding how the word-level bi-directional lstm (before the CRF layer) in the paper is reflected in the code, to be specific see the arrows in the image below.

image

Why is there only one word_lstm in the lm_lstm_crf.py ?

I see that in train_wc.py , if co_train is enabled, a bi-directional word level lstm is applied, but this after the CRF layer ?, shouldn't it be before the concatenated output passed to CRF as shown in the model architecture in the paper?
May be I am missing something really big & obvious :/

Thanks,

@nooralahzadeh
Copy link

By selecting co-train you just update the loss coming from LM, the bi-directional world level has been already applied on ner-model in lm_lstm_crf.py from following line in the code:

word_input = torch.cat((d_word_emb, d_char_out), dim = 2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants