Downloads · 30 days
727
1% of all-time downloads
Elron/bleurt-large-512
bleurt-large-512 is a text classification model from Elron. Use it when you need a label for a piece of text. It is set up for transformers.
Pytorch version of the original BLEURT models from ACL paper "BLEURT: Learning Robust Metrics for Text Generation" by Thibault Sellam, Dipanjan Das and Ankur P. Parikh of Google Research.
Downloads · 30 days
727
1% of all-time downloads
All-time downloads
136K
Public
Repo size
2.7 GB
Likes
1
Public
Click a slice to open those files.
.bin1.3 GB · 100%
From the Hugging Face model README
Pytorch version of the original BLEURT models from ACL paper "BLEURT: Learning Robust Metrics for Text Generation" by Thibault Sellam, Dipanjan Das and Ankur P. Parikh of Google Research.
The code for model conversion was originated from this notebook mentioned here.
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
tokenizer = AutoTokenizer.from_pretrained("Elron/bleurt-large-512")
model = AutoModelForSequenceClassification.from_pretrained("Elron/bleurt-large-512")
model.eval()
references = ["hello world", "hello world"]
candidates = ["hi universe", "bye world"]
with torch.no_grad():
scores = model(**tokenizer(references, candidates, return_tensors='pt'))[0].squeeze()
print(scores) # tensor([0.9877, 0.0475])