data2vec
              
                 
                
            
          copied
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			Readme
Files and versions
Updated 3 years ago
text-embedding
Text Embedding with data2vec
author: David Wang
Description
This operator extracts features for text with data2vec. The core idea is to predict latent representations of the full input data based on a masked view of the input in a self-distillation setup using a standard Transformer architecture.
Code Example
Use the pre-trained model to generate a text embedding for the sentence "Hello, world.".
Write the pipeline in simplified style:
import towhee
towhee.dc(["Hello, world."]) \
      .text_embedding.data2vec() \
      .show()
Factory Constructor
Create the operator via the following factory method
data2vec()
Interface
Parameters:
 text: str
 The text in string.
Returns: numpy.ndarray
 The text embedding extracted by model.
|  | 5 Commits | ||
|---|---|---|---|
|  | 
												1.1 KiB
											 | 3 years ago | |
|  | 
												904 B
											 | 3 years ago | |
|  | 
												730 B
											 | 3 years ago | |
|  | 
												1.1 KiB
											 | 3 years ago | |
|  | 
												0 B
											 | 3 years ago | |
|  | 
												39 B
											 | 3 years ago | |
