0% found this document useful (0 votes)
3 views7 pages

Program2 Lab

The document outlines a program to visualize word embeddings using Word2Vec and dimensionality reduction techniques like PCA and t-SNE. It describes the aim of performing word analogy operations and analyzing semantic relationships among words. The required software and algorithm steps for implementation are also provided.

Uploaded by

sanjanabk04
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views7 pages

Program2 Lab

The document outlines a program to visualize word embeddings using Word2Vec and dimensionality reduction techniques like PCA and t-SNE. It describes the aim of performing word analogy operations and analyzing semantic relationships among words. The required software and algorithm steps for implementation are also provided.

Uploaded by

sanjanabk04
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Program: 2

Use dimensionality reduction (e.g., PCA or t-SNE) to visualize word embeddings for Q 1. a
specific domain (e.g., sports, technology) and visualize their embeddings. Analyze clusters
and relationships. Generate contextually rich outputs using embeddings. Write a program to
generate 5 semantically Select 10 words from similar words for a given input.

Title
Exploring Word Relationships and Visualizing Word Embeddings using Word2Vec
Aim
To perform word analogy operations using Word2Vec and visualize semantic relationships using
PCA and t-SNE techniques.
Software Requirements
 Python 3.x
 Gensim
 NumPy
 Matplotlib
 Scikit-learn

Theory

Word2Vec is a neural network-based model that converts words into dense vector
representations. Semantic relationships between words can be discovered using vector
arithmetic. Dimensionality reduction techniques such as PCA and t-SNE help visualize high-
dimensional embeddings in 2D space.

Algorithm
 Import required libraries.
 Load pre-trained Word2Vec model.
 Accept three words as input.
 Perform vector arithmetic:
word1 − word2 + word3
 Find most similar words using cosine similarity.
 Remove input words from results.
 Collect word vectors for visualization.
 Reduce dimensions using PCA and t-SNE.
 Plot words on a 2D graph.

Source Code:
Continue….
Continue……
Continue….
Output:

Continue….
Continue….

You might also like