Created
February 20, 2022 22:40
-
-
Save shayaf84/40eac136c5d737ba3c4b2b374b4c4daa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
# Input Layers | |
input_layer = tf.keras.layers.Input(shape=(), dtype=tf.string, name='news') | |
# BERT layers | |
processed = bert_preprocess(input_layer) | |
output = bert_encoder(processed) | |
# Fully Connected Layers | |
layer = tf.keras.layers.Dropout(0.2, name='dropout')(output['pooled_output']) | |
layer = tf.keras.layers.Dense(10,activation='relu', name='hidden')(layer) | |
layer = tf.keras.layers.Dense(1,activation='sigmoid', name='output')(layer) | |
model = tf.keras.Model(inputs=[input_layer],outputs=[layer]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment