|
--- |
|
language: |
|
- ko |
|
tags: |
|
- generated_from_keras_callback |
|
model-index: |
|
- name: RoBERTa-large-Detection-P2G |
|
results: [] |
|
--- |
|
|
|
# RoBERTa-large-Detection-P2G |
|
|
|
|
|
์ด ๋ชจ๋ธ์ klue/roberta-large์ ๊ตญ๋ฆฝ ๊ตญ์ด์ ์ ๋ฌธ ๋ง๋ญ์น 5๋ง๊ฐ์ ๋ฌธ์ฅ์ 2021์ g2pK๋ก ํ๋ จ์์ผ G2P๋ ๋ฐ์ดํฐ๋ฅผ ํ์งํฉ๋๋ค.<br> |
|
git : https://github.com/taemin6697<br> |
|
|
|
## Usage |
|
```python |
|
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 |
|
``` |
|
|
|
|
|
## Intended uses & limitations |
|
|
|
More information needed |
|
|
|
## Training and evaluation data |
|
|
|
More information needed |
|
|
|
## Training procedure |
|
|
|
### Training hyperparameters |
|
|
|
The following hyperparameters were used during training: |
|
- optimizer: None |
|
- training_precision: float16 |
|
### Training results |
|
### Framework versions |
|
- Transformers 4.22.1 |
|
- TensorFlow 2.10.0 |
|
- Datasets 2.5.1 |
|
- Tokenizers 0.12.1 |