Giter Site home page Giter Site logo

Comments (4)

beyondguo avatar beyondguo commented on August 17, 2024 4

read through the paper, I didn’t find what w2v embedding other models(such as LSTM,CNN) are using. It is amazing that SWEM -ave can achieve better results than LSTM or CNN in some tasks, which in fact I don’t believe! I have done a lot of nlp tasks and I know that simply average the word embedding of a text is usually very poor.
I don’t think the comparisons of other models are fair. They don’t even use the same pretrained w2v. So maybe it’s just the Glove you used is better than the embedding other models used.

from swem.

dinghanshen avatar dinghanshen commented on August 17, 2024

To your questions/concerns:

First, the same word embeddings (Glove) were used for both LSTM and CNN to ensure fair comparison.

Second, you should be really careful while implementing the simple average operation to obtain sentence embeddings. Specifically, a mask is needed to remove the influence of padding tokens. Otherwise the paddings will hurt the final performance a lot. This is what I have implemented in this codebase.

Finally, we have tried to shuffle the words in every sentence and the LSTM gives the same accuracy. In other words, LSTM does not leverage the word order information at all, or the information is not useful for the tasks considered.

from swem.

beyondguo avatar beyondguo commented on August 17, 2024

Thanks for replying so fast.
In paper [Character-level Convolutional Networks for TextClassification] where the results of LSTM/bag-of-means/CNNs are reported, I couldn't find the evidence that they were using Glove. Actually, that paper didn't even cite Pennington's Glove paper. I only noticed that both of you used the same dimension of w2v---300. So I still have doubts for this.

As for the trick for average pooling that mask should be applied, I also noticed it from your code. I will try it and see its effectiveness. Thanks for this important information.

Although I still have soncerns,I believe all the results in your paper are true. So if the simple baseline can beat so many powerful complicated models such as LSTM and CNNs, dose that mean the LSTM and CNNs and fasttext have no use, which is widely implemented in industry and reasearch? Because even they are slightly better than SWEM, their computational cost is much higher.

from swem.

Cppowboy avatar Cppowboy commented on August 17, 2024

Is the LSTM or CNN model implemented with mask?

from swem.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.