Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
import tensorflow as tf
import numpy as np
 
class TextCNN(object):
    '''
    A CNN for text classification.
    Uses an embedding layer, followed by a convolutional, max-pooling and softmax layer.
    '''
    def __init__(
      self, sequence_length, num_classes, vocab_size,
      embedding_size, filter_sizes, num_filters):
        # Implementation...