in this homework, we will implement a relation extraction model using PyTorch. The model is based on the
The project uses Python 3.10 which has some linting defaults which may cause import errors if using python < 3.10 and PyTorch
The requirements can be installed using the following command:
pip install -r requirements.txt
The code has been written in jupyter notebook so that each part can be run individually and test different senarios and variables along the way. The notebook can also be imported into colab as well if you prefer working in the cloud GPU.
The project is structured as follows:
.
├── data
│ ├── hw1_test-2.csv
│ ├── hw1_train-2.csv
│ └── sampleSubmission-2.csv
├── output
│ ├── best_model.pt
│ └── submission_labels.csv
├── README.md
├── requirements.txt
└── notebook.ipynb
The data
folder contains the data files for the project. The notebook
is a jupyter notebook which contains the code
for the project.
For this task, I've used different models with different structres, including bi-LSTM, MLP, with different number of hidden layers and methods like dropout, different learning rate, and using leaky relu activation.
Parsa Mazaheri, November 2022