Skip to main content

Transformer Text AutoEncoder: An autoencoder is a type of artificial neural network used to learn efficient encodings of unlabeled data, the same is employed for textual data employing pre-trained models from the hugging-face library.

Project description

Transformer-Text-AutoEncoder

Transformer Text AutoEncoder: An autoencoder is a type of artificial neural network used to learn efficient encodings of unlabeled data, the same is employed for textual data employing pre-trained models from the hugging-face library.

Installation:

pip install Transformer-Text-AutoEncoder

Execution:

from Transformer_Text_AutoEncoder.AutoEncoder import TTAE

def read(path='./data/FinancialNews.txt'):
  with open(path, "r", encoding='utf-8', errors='ignore') as f:
    data = [i.strip() for i in f.readlines()]
  return data

sentences = read()
print(sentences[:3])
ttae = TTAE(sentences)
ttae.train(10, batch_size=1)
print(ttae.predict("According to Gran , the company has no plans to move all production to Russia , although that is where the company is growing ."))

returns the predicted sentence as well as the embeddings.

Cite Work:

@inproceedings{ttae,
  title = {Transformer-Text-AutoEncoder},
  author = {Aman Priyanshu},
  year = {2022},
  publisher = {{GitHub}},
  url = {https://github.com/AmanPriyanshu/Transformer-Text-AutoEncoder/}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Transformer_Text_AutoEncoder-0.0.4.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Transformer_Text_AutoEncoder-0.0.4-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file Transformer_Text_AutoEncoder-0.0.4.tar.gz.

File metadata

File hashes

Hashes for Transformer_Text_AutoEncoder-0.0.4.tar.gz
Algorithm Hash digest
SHA256 038d04495cb0cb38ad6521a31f06f5712a6a2f633bf65ada4383bc6a18f7a0ec
MD5 39768d469862fb6eb71f6d962b336603
BLAKE2b-256 19f97dd9d36ec8d1b362238d71b12813a4e282aacab1fc1eeeb8040243c8f0b4

See more details on using hashes here.

File details

Details for the file Transformer_Text_AutoEncoder-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for Transformer_Text_AutoEncoder-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 132bf0aacf2f5d9a9a696cde6f1757d68b7c7bab6e3f3ef90c5a8a370f8bed8b
MD5 3b12ade8344db5b804c308c69edf0aad
BLAKE2b-256 c00c91417d99b8968adc6ff8979ca0de471cee8057e28bb2a1650ee1f54c84ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page