Coder Social home page Coder Social logo

packtpublishing / natural-language-processing-with-tensorflow Goto Github PK

View Code? Open in Web Editor NEW
270.0 22.0 163.0 4.06 MB

Natural Language Processing with TensorFlow, published by Packt

License: MIT License

Jupyter Notebook 99.59% Python 0.41%
tensorflow nlp-machine-learning rnn cnn tensorboard seq2seq lstm

natural-language-processing-with-tensorflow's Introduction

Natural Language Processing with TensorFlow

This is the code repository for Natural Language Processing with TensorFlow, published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.

About the Book

Natural language processing (NLP) supplies the majority of data available to deep learning applications, while TensorFlow is the most important deep learning framework currently available. Natural Language Processing with TensorFlow brings TensorFlow and NLP together to give you invaluable tools to work with the immense volume of unstructured data in today’s data streams, and apply these tools to specific NLP tasks.

Thushan Ganegedara starts by giving you a grounding in NLP and TensorFlow basics. You'll then learn how to use Word2vec, including advanced extensions, to create word embeddings that turn sequences of words into vectors accessible to deep learning algorithms. Chapters on classical deep learning algorithms, like convolutional neural networks (CNN) and recurrent neural networks (RNN), demonstrate important NLP tasks as sentence classification and language generation. You will learn how to apply high-performance RNN models, like long short-term memory (LSTM) cells, to NLP tasks. You will also explore neural machine translation and implement a neural machine translator.

After reading this book, you will gain an understanding of NLP and you'll have the skills to apply TensorFlow in deep learning NLP applications, and how to perform specific NLP tasks.

Instructions and Navigations

All of the code is organized into folders. Each folder starts with a number followed by the application name. For example, Chapter02.

The code will look like the following:

graph = tf.Graph() # Creates a graph
session = tf.InteractiveSession(graph=graph) # Creates a session

To get the most out of this book, we assume the following from the reader:

  • A solid will and an ambition to learn the modern ways of NLP
  • Familiarity with basic Python syntax and data structures (for example, lists and dictionaries)
  • A good understanding of basic mathematics (for example, matrix/vector multiplication)
  • (Optional) Advance mathematics knowledge (for example, derivative calculation) to understand a handful of subsections that cover the details of how certain learning models overcome potential practical issues faced during training
  • (Optional) Read research papers to refer to advances/details in systems, beyond what the book covers

Related Products

Download a free PDF

If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

https://packt.link/free-ebook/9781788478311

natural-language-processing-with-tensorflow's People

Contributors

packt-itservice avatar packtbhagyashree avatar packtutkarshr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

natural-language-processing-with-tensorflow's Issues

matplotlib.cm.spectral has been removed

pylab.cm.spectral as used in the ch3_word2vec notebook when plotting the t-SNE causes an error. I worked around it with by using
pylab.cm.nipy_spectral
instead.

bugs in document_embedding

Hello. I found a bug while looking through the code, ch4/ch4_document_embedding.ipynb

Batch is not just a vector, but a matrix. I added the code to generate batches of data for skip-gram

`

batch = np.ndarray(shape=(batch_size, span-1), dtype=np.int32)
labels = np.ndarray(shape=(batch_size, 1), dtype=np.int32)

`

below this code, you can find a for-loop

`

for i in range(batch_size // num_samples):
    k = 0
    for j in list(range(window_size)) + list(range(window_size + 1, 2 * window_size + 1)):
        batch[i * num_samples + k] = buffer[window_size]
        labels[i * num_samples + k, 0] = buffer[j]
        k += 1

`

In this for loop, batch is considered as an array(or a vector), not a matrix. Because of this problem, after the for-loop, batch contains same value when axis=0. For example,

`

array([[2, 2, 2, 2],
[2, 2, 2, 2],
[2, 2, 2, 2],
[2, 2, 2, 2],
[3, 3, 3, 3],
[3, 3, 3, 3],
[3, 3, 3, 3],
[3, 3, 3, 3]], dtype=int32)

`
I think these're not appropriate training data for doc2vec algorithm. Can you please check if it has a problem or just I misunderstand something. Thank you.

Bug in lstm_image_caption_pretrained_wordvecs_rnn_api

Hello,
I found a bug in ch9/lstm_image_caption_pretrained_wordvecs_rnn_api.ipynb, In [8],
Building the Dictionary with Clean Data. Under instruction dictionary = {'SOS':0, 'EOS': 1} , It seemed to lose an important instruction unique_words = list(set(word_list)), so that the dictionary and reverse_dictionary contents didn't change by using clean data.

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.