Datasets:

Modalities:
Text
Formats:
parquet
Languages:
English
Libraries:
Datasets
Dask
License:
arxiv_abstracts / exampleEmbed.py
willdepue's picture
Upload 4 files
2658eec
Raw
History Blame Contribute Delete
808 Bytes
from InstructorEmbedding import INSTRUCTOR
model = INSTRUCTOR('hkunlp/instructor-xl')
sentence = "The dominant sequence transduction models are based on complex recurrent or convolutional neural networks in an encoder-decoder configuration. The best performing models also connect the encoder and decoder through an attention mechanism. We propose a new simple network architecture, the Transformer, based solely on attention mechanisms, dispensing with recurrence and convolutions entirely. Experiments on two machine translation tasks show these models to be superior in quality while being more parallelizable and requiring significantly less time to train."
instruction = "Represent the Research Paper abstract for retrieval; Input:"
embeddings = model.encode([[instruction,sentence]])
print(embeddings)