This is the official implementation of the paper:

Navigate to the Bert directory:
cd Bert
Install necessary packages:
!pip install transformers==4.40.0 torch==2.3.0 scikit-learn ==1.4.2 nltk==3.8.1 retry==0.9.2
!pip install flash-attn --no-build-isolation
!pip install pytorch_metric_learning
Run the TACRED training:
python train_tacred_final.py --task_name Tacred --num_k 5
Run the FewRel training:
python train_fewrel_final.py --task_name FewRel --num_k 5
Navigate to the Llama2,Llama3,Mistral in 'LLMEs'directory:
Install necessary packages:
!pip install transformers==4.40.0 torch==2.3.0 scikit-learn ==1.4.2 nltk==3.8.1 retry==0.9.2
!pip install llm2vec==0.2.2
!pip install flash-attn --no-build-isolation
!pip install pytorch_metric_learning
Log in to Hugging Face:
!huggingface-cli login --token your_huggingface_token_to_access_model
python train_tacred_final.py --task_name Tacred --num_k 5
python train_fewrel_final.py --task_name FewRel --num_k 5
float32 for fair comparison with Quyen et al.bf16.config.ini.9 commits
Python
92.2%
Jupyter Notebook
7.7%
This is the official implementation of the paper:

Navigate to the Bert directory:
cd Bert
Install necessary packages:
!pip install transformers==4.40.0 torch==2.3.0 scikit-learn ==1.4.2 nltk==3.8.1 retry==0.9.2
!pip install flash-attn --no-build-isolation
!pip install pytorch_metric_learning
Run the TACRED training:
python train_tacred_final.py --task_name Tacred --num_k 5
Run the FewRel training:
python train_fewrel_final.py --task_name FewRel --num_k 5
Navigate to the Llama2,Llama3,Mistral in 'LLMEs'directory:
Install necessary packages:
!pip install transformers==4.40.0 torch==2.3.0 scikit-learn ==1.4.2 nltk==3.8.1 retry==0.9.2
!pip install llm2vec==0.2.2
!pip install flash-attn --no-build-isolation
!pip install pytorch_metric_learning
Log in to Hugging Face:
!huggingface-cli login --token your_huggingface_token_to_access_model
python train_tacred_final.py --task_name Tacred --num_k 5
python train_fewrel_final.py --task_name FewRel --num_k 5
float32 for fair comparison with Quyen et al.bf16.config.ini.9 commits
Python
92.2%
Jupyter Notebook
7.7%