8

Is there any example on how can TensorFlow be used for text classification using neural networks?

Sumit Chawla
  • 369
  • 1
  • 4
  • 13

2 Answers2

4

I've started putting together a set of examples for text classification on DBPedia dataset (predicting class of object from its description) as part of examples for Scikit Flow: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/learn/text_classification.py

Going to expand this example and write a blog post when will have enough different models showcased. Feel free to suggest other datasets and models you would be interested to see.

Alexander Ejbekov
  • 5,594
  • 1
  • 26
  • 26
ilblackdragon
  • 1,834
  • 12
  • 12
  • Thanks a lot @ilblackdragon. I am able to make use of your example. It will be great help if you can document the **rnn_model** function. – Sumit Chawla Nov 30 '15 at 20:05
  • 1
    @SumitChawla I've added a bunch of comments in the example: https://github.com/google/skflow/blob/master/examples/text_classification.py and will try to write a blog post in close future about this types of the models. Let me know if you still have questions though. – ilblackdragon Dec 06 '15 at 02:44
  • How can we test the model. There is save and restore file but one sentence at a time. Any tutorial? Please help. – Wazy Apr 18 '16 at 09:16
  • 1
    update to the URL: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/skflow/text_classification.py – lababidi Apr 21 '16 at 20:19
  • 1
    It's here now :- https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/learn/text_classification.py – Shatu Nov 25 '16 at 22:40
3

Denny Britz has some great tutorials for Deep learning on his blog at here

and has an example on github here

Some of his examples don't use tensor flow but the one I linked to github uses CNN for text classification using tensor flow

Camron_Godbout
  • 1,583
  • 1
  • 15
  • 22