This repository contains a simple implementation of the GloVe technique for generating word embeddings in Python. GloVe (Global Vectors for Word Representation) is a popular unsupervised learning method that leverages co-occurrence information from large-scale corpora to produce dense word vectors.
Before using the package, you need to install the required dependencies. To do this, make sure you have a requirements.txt file in your project's root directory. Then, follow these steps:
-
Ensure you have Python installed on your system. This project is compatible with Python 3.x.
-
Install the required dependencies from the requirements.txt file:
pip install -r requirements.txt
That's it! You've now installed the necessary dependencies for this project.
To use the GloVe implementation in your project, follow these steps:
- Modify the last lines in the code and add your words
similarity = get_word_similarity(embeddings, word2id, 'sun', 'sky')
print(f"The distance between the two words is: {similarity}")
- Run the code
python3 ./src/main.py