jiesutd / LatticeLSTM

Chinese NER using Lattice LSTM. Code for ACL 2018 paper.
1.79k stars 457 forks source link

The training time is too long. #4

Closed Robets2020 closed 6 years ago

Robets2020 commented 6 years ago

I try to train a model on msra data using a nvidia 1080 Ti, and it takes about 120 seconds on 500 sentences. It is acceptable on small data set, but if the data set is larger, for instance, 5 times bigger than msra, the training time is too long.

Is there any way to speed up the training speed?

jiesutd commented 6 years ago

Currently the code only process sentence one by one, the batched version has not been implemented yet. I am afraid the speed can not be improved until the batched implementation finished. I do not have time to implement it recently, unfortunately.

Robets2020 commented 6 years ago

What is the difficulty of implementing a batched version? Is it the different number of matching words associated with each char in a sentence? Is it necessary to pad the matching words to same number to implement a batched version?

jiesutd commented 6 years ago

Yes, the different number of matching words is one problem, for both the beginning character and end character. Padding and mask can solve this problem but need more code work.