logo
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

towhee

Operator: nlp-longformer

Author: Kyle He, Jael Gu

Overview

Interface

__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'
__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

Jael Gu 6039f6471c Update 3 Commits
file-icon README.md
837 B
download-icon
Update 3 years ago
file-icon __init__.py
0 B
download-icon
Add operator 3 years ago
file-icon nlp_longformer.py
1.4 KiB
download-icon
Update 3 years ago