keywordGen-v2 / README.md
mrutyunjay-patil's picture
Update README.md
f39bcc9
|
raw
history blame
2.23 kB
metadata
license: apache-2.0
pipeline_tag: text2text-generation
language:
  - en
library_name: transformers
tags:
  - code
  - keyword-generation
  - english
  - t5

Keyword Generator v2

Model Description

This model, "KeywordGen-v2", is the second version of the "KeywordGen" series. It is fine-tuned based on the T5 base model, specifically for the generation of keywords from text inputs, with a special focus on product reviews.

This model can provide useful insights by extracting key points or themes from product reviews. The output is expected to contain keywords ranging from 2 to 8 words. The model performs better when the input is at least 2-3 sentences long.

How to use

You can use this model directly with a pipeline for text generation. When using the model, please prefix your input with "Keyword: " for the best results.

Here's how to use this model in Python with the Hugging Face Transformers library:

from transformers import T5Tokenizer, T5ForConditionalGeneration

# Initialize the tokenizer and model
tokenizer = T5Tokenizer.from_pretrained("mrutyunjay-patil/keywordGen-v2")
model = T5ForConditionalGeneration.from_pretrained("mrutyunjay-patil/keywordGen-v2")

# Define your input sequence, prefixing with "Keyword: "
input_sequence = "Keyword: I purchased the new Android smartphone last week and I've been thoroughly impressed. The display is incredibly vibrant and sharp, and the battery life is surprisingly good, easily lasting a full day with heavy usage."

# Encode the input sequence
input_ids = tokenizer.encode(input_sequence, return_tensors="pt")

# Generate output
outputs = model.generate(input_ids)
output_sequence = tokenizer.decode(outputs[0], skip_special_tokens=True)

print(output_sequence)

Training

This model was trained on a custom dataset. The base model used was the T5 base model.

Limitations and Future Work

As with any machine learning model, the outputs of this keyword generator depend on the data it was trained on. It is possible that the model might generate inappropriate or biased keywords if the input text contains such content. Future iterations of the model will aim to improve its robustness and fairness, and to minimize potential bias.