BoostCamp AI Tech NLP Model
Collection
4 items
โข
Updated
์ด ๋ชจ๋ธ์ klue/roberta-large์ ๊ตญ๋ฆฝ ๊ตญ์ด์ ์ ๋ฌธ ๋ง๋ญ์น 5๋ง๊ฐ์ ๋ฌธ์ฅ์ 2021์ g2pK๋ก ํ๋ จ์์ผ G2P๋ ๋ฐ์ดํฐ๋ฅผ ํ์งํฉ๋๋ค.
git : https://github.com/taemin6697
from transformers import AutoTokenizer, RobertaForSequenceClassification
import torch
import numpy as np
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model_dir = "kfkas/RoBERTa-large-Detection-G2P"
tokenizer = AutoTokenizer.from_pretrained('klue/roberta-large')
model = RobertaForSequenceClassification.from_pretrained(model_dir).to(device)
text = "์๋์ปค ํ๋์ํ ๋ํํฐ๋ฉ ํ์ฐ๋ฌ ์ด๋ฌ๋ฌ ์ด์์์ฅ ์ ๋ฌผ"
with torch.no_grad():
x = tokenizer(text, padding='max_length', truncation=True, return_tensors='pt', max_length=128)
y_pred = model(x["input_ids"].to(device))
logits = y_pred.logits
y_pred = logits.detach().cpu().numpy()
y = np.argmax(y_pred)
print(y)
#1
More information needed
More information needed
The following hyperparameters were used during training: