Edit model card

Personalised opener

This model creates an opener based on a provided interest.

Model input

[INTEREST]

Example

dancing

Output

What's your favorite dance move to make people laugh or cry?

How to use in code

import nltk
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("njvdnbus/personalised_opener-t5-large")
model = AutoModelForSeq2SeqLM.from_pretrained("njvdnbus/personalised_opener-t5-large")

def use_model(text):
    inputs = ["" + text]
    inputs = tokenizer(inputs, truncation=True, return_tensors="pt")
    output = model.generate(**inputs, num_beams=1, do_sample=True, min_length=10, max_length=256)
    decoded_output = tokenizer.batch_decode(output, skip_special_tokens=True)[0]
    predicted_interests = nltk.sent_tokenize(decoded_output.strip())[0]
    return predicted_interests

text= "tennis"
print(use_model(text))

Do you think tennis is the most exciting sport out there?

Downloads last month
3
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.