Giter VIP home page Giter VIP logo

Comments (4)

Tixierae avatar Tixierae commented on May 12, 2024

Hi, thank you for your interest! The code was tested with Python 3.5.5 and 3.6.1, tensorflow-gpu 1.5.0, Keras 2.2.0, and gensim 3.2.0. I guess it's probably the problem (Keras has been integrated into TF now).
I should regularly update the code, but don't have time. If you end up updating the code, feel free to make a pull request.

from deep_learning_nlp.

vedtam avatar vedtam commented on May 12, 2024

Thanks so much for the details. I've created an env with the above dependencies and now things work as expected. I've been trying to add my own data, which consists of 8 categories (instead of the default 5). My dataset contains 4000 training and ~380 test samples.

After preprocessing my data (using your preprocessor script), I can load the word vectors, train a model for analysing the results, but then another error pops up: max() arg is an empty sequence, with all the acc and loss plots being blank:

Screen Shot 2021-01-26 at 18 27 36

If I proceed with re-initialising and training a model to get a visualisation of the document embeddings I hit an error again: operands could not be broadcast together with shapes (8,8) (7,7) :

Screen Shot 2021-01-27 at 00 44 43

I've updated the n_cats=8 initialy and restarted the notebook several times, but it still throws about incompatible shapes (8,8) (7,7). I'm wondering, is this because of how the programatic batch creation? Maybe the some documents in a batch doesn't have the same size? Pff, can't figure it out.

from deep_learning_nlp.

Tixierae avatar Tixierae commented on May 12, 2024

Did you find what the problem was? It's difficult to troubleshoot this issue without a reproducible example, and I am very busy these days anyways, but could it be possibly due to your labels following a zero-based index? By default, they are assumed to follow a one-based index. Change this parameter if not:

one_based_labels = True # Remember to change this when changing dataset!E.g., should be False for IMDB.

from deep_learning_nlp.

vedtam avatar vedtam commented on May 12, 2024

@Tixierae thanks! Figured it out and got the notebook working. I'm wondering, why is there so little info (after days of searching found only your's and one more) about this approach for getting the weights over words and thus being able to explain an NLP deep learning model's behaviour? Is it really that obvious so anyone (but me) can implement it. Or is it already outdated, along deep learning NLP models (there might be a better way like transformers or something)?

Thanks!

from deep_learning_nlp.

Related Issues (3)

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.