Downloads · 30 days
11
0% of all-time downloads
figurative-nlp/t5-figurative-paraphrase
t5-figurative-paraphrase is a machine learning model from figurative-nlp. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
This model can convert the figurative/metaphorical expression to the literal expression. Below is the usage of our model:
Downloads · 30 days
11
0% of all-time downloads
All-time downloads
2.4K
Public
Repo size
1.8 GB
Likes
4
Public
Click a slice to open those files.
.bin892 MB · 100%
From the Hugging Face model README
This model can convert the figurative/metaphorical expression to the literal expression. Below is the usage of our model:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("figurative-nlp/t5-figurative-paraphrase")
model = AutoModelForSeq2SeqLM.from_pretrained("figurative-nlp/t5-figurative-paraphrase")
input_ids = tokenizer(
"paraphrase the sentence : i will talk this story to you from A to Z", return_tensors="pt"
).input_ids # Batch size 1
outputs = model.generate(input_ids,num_beams = 5)
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
#result : i will talk this story to you from beginning to end..
For example:
Input: He is always bang on when he makes a speech.
Output: He is always presice when he makes a speech.
Input: He always buy what he said.
Output: He always agree with what he said.
Input: Your team will be done like dinner if they play against the all-star team.
Output: Your team will be defeated if they play against the all-star team. (the one is not particularly accurate)
Note: the figurative language here includes metaphor, idiom and simile. We don't guarantee that the results generated results are satisfactory to you. We are trying to improve the effect of the model.