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.
|
|
|
# Operator: nlp-longformer
|
|
|
|
|
|
|
|
Author: Kyle He, Jael Gu
|
|
|
|
|
|
|
|
## Overview
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Interface
|
|
|
|
|
|
|
|
```python
|
|
|
|
__init__(self, model_name: str, framework: str = 'pytorch')
|
|
|
|
```
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
|
|
|
- model_name:
|
|
|
|
- the model name for embedding
|
|
|
|
- supported types: str, for example 'xxx' or 'xxx'
|
|
|
|
- framework:
|
|
|
|
- the framework of the model
|
|
|
|
- supported types: str, default is 'pytorch'
|
|
|
|
|
|
|
|
```python
|
|
|
|
__call__(self, call_arg_1: xxx)
|
|
|
|
```
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
|
|
|
- txt:
|
|
|
|
- input text in words, sentences, or paragraphs
|
|
|
|
- supported types: str
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
|
|
|
The Operator returns a tuple Tuple[('feature_vector', numpy.ndarray)] containing following fields:
|
|
|
|
|
|
|
|
- feature_vector:
|
|
|
|
- the embedding of the text
|
|
|
|
- data type: numpy.ndarray
|
|
|
|
- shape: (x, dim) where x is number of vectors and dim is dimension of vector depending on model_name
|
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## How it works
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Reference
|