import csv import pandas as pd import json import sentence_transformers.util import torch from sentence_transformers import SentenceTransformer from torch import nn if __name__ == '__main__': train = pd.read_csv(r'E:\Data\Research\Projects\matching_dependency\datasets\Fodors-Zagats\train.csv', encoding='ISO-8859-1') valid = pd.read_csv(r'E:\Data\Research\Projects\matching_dependency\datasets\Fodors-Zagats\valid.csv', encoding='ISO-8859-1') test = pd.read_csv(r'E:\Data\Research\Projects\matching_dependency\datasets\Fodors-Zagats\test.csv', encoding='ISO-8859-1') train = train[train['label'] == 1] valid = valid[valid['label'] == 1] test = test[test['label'] == 1] matches = pd.concat([train, valid, test]) matches.drop(columns=['label'], inplace=True) matches = matches.sort_values(by='ltable_id') matches.to_csv(r'E:\Data\Research\Projects\matching_dependency\datasets\Fodors-Zagats\matches.csv', sep=',', index=False, header=True)