Skip to content

Commit

Permalink
Create word_embedding.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH committed May 11, 2024
1 parent 440843f commit 28f72dc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions natural_language_processing/word_embedding.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import tensorflow as tf
from tensorflow.keras.layers import Embedding

def generate_word_embeddings(vocab_size, embedding_dim):
# Generate word embeddings using a pre-trained embedding layer
embeddings = Embedding(vocab_size, embedding_dim, input_length=1)

return embeddings

0 comments on commit 28f72dc

Please sign in to comment.