Downloads · 30 days
5
0% of all-time downloads
Kateryna/eva_ru_forum_headlines
eva_ru_forum_headlines is a machine learning model from Kateryna. 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.
The model was trained on forum topics names and first posts (100 - 150 words). It generates short headlines (3 - 5 words) in the opposite to headlines from models trained on newspaper articles.
Downloads · 30 days
5
0% of all-time downloads
All-time downloads
1.5K
Public
Repo size
2 GB
Likes
1
Public
Click a slice to open those files.
.bin977 MB · 100%
From the Hugging Face model README
The model was trained on forum topics names and first posts (100 - 150 words). It generates short headlines (3 - 5 words) in the opposite to headlines from models trained on newspaper articles.
"I do not know how to title this post" can be a valid headline. "What would you do in my place?" is one of the most popular headline.
from transformers import AutoTokenizer, T5ForConditionalGeneration
model_name = "Kateryna/eva_ru_forum_headlines"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = T5ForConditionalGeneration.from_pretrained(model_name)
text = "Я влюбилась в одного парня. Каждый раз, когда он меня видит, он плюется и переходит на другую сторону улицы. Как вы думаете, он меня любит?"
input_ids = tokenizer(
[text],
max_length=150,
add_special_tokens=True,
padding="max_length",
truncation=True,
return_tensors="pt"
)["input_ids"]
output_ids = model.generate(
input_ids=input_ids,
max_length=25,
num_beams=4,
repetition_penalty=5.0,
no_repeat_ngram_size=4
)[0]
headline = tokenizer.decode(output_ids, skip_special_tokens=True)
print(headline)
Training dataset: https://huggingface.co/datasets/Kateryna/eva_ru_forum_headlines
From all available posts and topics names I selected only posts and abstractive topic names e.g. the topic name does not match exactly anything in the correspondent post.
The base model is cointegrated/rut5-base
Training parameters:
ROUGE and BLUE scores were not very helpful to choose a best model.
I manually estimated ~100 results in each candidate model.
https://github.com/KaterynaD/eva.ru/tree/main/Code/Notebooks/9.%20Headlines