Text Generation Using Keywords
Project description
keytotext
Idea is to build a model which will take keywords as inputs and generate sentences as outputs.
Potential use case can include:
- Marketing
- Search Engine Optimization
- Topic generation etc.
- Fine tuning of topic modeling models
Model:
Keytotext is based on the Amazing T5 Model:
k2t
: Modelk2t-tiny
: Modelk2t-base
: Modelmrm8488/t5-base-finetuned-common_gen
(by Manuel Romero): Model
Training Notebooks can be found in the Training Notebooks
Folder
Note: To add your own model to keytotext Please read Models Documentation
Usage:
Example Notebooks can be found in the Notebooks
Folder
pip install keytotext
Trainer:
Keytotext now has a trainer class than be used to train and finetune any T5 based model on new data. Trainer docs here: Docs
from keytotext import trainer
UI:
pip install streamlit-tags
This uses a custom streamlit component built by me: GitHub
API:
The API is hosted in the Docker container and it can be run quickly. Follow instructions below to get started
docker pull gagan30/keytotext
docker run -dp 8000:8000 gagan30/keytotext
This will start the api at port 8000 visit the url below to get the results as below:
http://localhost:8000/api?data=["India","Capital","New Delhi"]
Note: The Hosted API is only available on demand
BibTex:
To quote keytotext please use this citation
@misc{bhatia,
title={keytotext},
url={https://github.com/gagan3012/keytotext},
journal={GitHub},
author={Bhatia, Gagan}
}
References
- https://github.com/Shivanandroy/simpleT5 (Shivanand Roy)
- https://github.com/patil-suraj/question_generation (Suraj Patil)
- https://github.com/MathewAlexander/T5_nlg (Mathew Alexander)
Articles about keytotext:
- https://towardsdatascience.com/data-to-text-generation-with-t5-building-a-simple-yet-advanced-nlg-model-b5cce5a6df45 (Mathew Alexander)
- Amazing Video by 1LittleCoder here: https://www.youtube.com/watch?v=I0iBzP-SxFY about keytotext
- https://medium.com/mlearning-ai/generating-sentences-from-keywords-using-transformers-in-nlp-e89f4de5cf6b (Prakhar Mishra)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for keytotext-1.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a8ee764ce66b27c20c04855fca302d70fc21a541bb6fa169edd4dc63d9d75cb |
|
MD5 | 7609b17f53f5a2b6c6f629127a7e5405 |
|
BLAKE2b-256 | aca6274124ab5dac7f6ae157bd094ccc952cfa3e82e5275ba7e12323c7a9daeb |