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 7 months ago

towhee

BERT Text Embedding Operator (Pytorch)

Authors: Kyle He

Overview

This operator transforms text into embedding using BERT[1], which stands for Bidirectional Encoder Representations from Transformers.

Interface

__call__(self, text: str)

Args:

  • audio_path:
    • the text to be embedded
    • supported types: str

Returns:

The Operator returns a tuple Tuple[('embs', numpy.ndarray)] containing following fields:

  • embs:
    • embeddings of the text
    • data type: numpy.ndarray
    • shape: 768

Requirements

You can get the required python package by requirements.txt.

How it works

The towhee/torch-bert Operator is based on Huggingface[2].

Reference

[1]. https://arxiv.org/pdf/1810.04805.pdf

[2]. https://huggingface.co/docs/transformers

More Resources

Jael Gu ccf0085e52 Add more resources 4 Commits
file-icon README.md
2.4 KiB
download-icon
Add more resources 7 months ago
file-icon __init__.py
592 B
download-icon
add text embedding implementation 3 years ago
file-icon requirements.txt
32 B
download-icon
add text embedding implementation 3 years ago
file-icon torch_bert.py
2.0 KiB
download-icon
add text embedding implementation 3 years ago