MD-metrics-HPO
parent
3d10e93bdf
commit
4f61d93a30
@ -1,7 +1,13 @@
|
||||
import pandas as pd
|
||||
from sentence_transformers import SentenceTransformer
|
||||
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, AutoModelForTableQuestionAnswering
|
||||
|
||||
if __name__ == '__main__':
|
||||
model = SentenceTransformer('E:\\Data\\Research\\Models\\tapex-base-finetuned-wikisql')
|
||||
sentences = ['公积金转入深圳', '公积金转出深圳']
|
||||
embedding = model.encode(sentences, convert_to_tensor=True, device="cuda")
|
||||
path = r'E:\Data\Research\Projects\matching_dependency\datasets\DBLP-ACM\tableA.csv'
|
||||
table = pd.read_csv(path, low_memory=False, encoding='ISO-8859-1')
|
||||
|
||||
tokenizer = AutoTokenizer.from_pretrained(r'E:\Data\Research\Models\tapas-large-finetuned-wtq')
|
||||
model = AutoModelForTableQuestionAnswering.from_pretrained(r'E:\Data\Research\Models\tapas-large-finetuned-wtq')
|
||||
encoding = tokenizer(table, return_tensors="pt")
|
||||
embedding = tokenizer.encode(table, return_tensors="pt")
|
||||
print(1)
|
||||
|
Loading…
Reference in new issue