gpt-neox-125M-finetuned-nsmc

作者 cateto · 下载 6 · 点赞 0 · 更新 2023-11-02

Usage

from transformers import GPTNeoXTokenizerFast, GPTNeoXForSequenceClassification
model = GPTNeoXForSequenceClassification.from_pretrained("cateto/gpt-neox-125M-finetuned-nsmc")
tokenizer = GPTNeoXTokenizerFast.from_pretrained("cateto/gpt-neox-125M-finetuned-nsmc")

def sentiment_analysis(text):
    label_dict = { 0: "부정", 1: "긍정"}
    encoded_input = tokenizer(text, return_tensors='pt')
    prediction = model(encoded_input.input_ids).logits.argmax().item()
    print("prediction: ", label_dict[prediction])

sentiment_analysis('이 영화 진짜 돈 아까움 ;;')
## prediction:  부정
sentiment_analysis('진짜 죽기 전에 꼭 봐야 하는 영화 ㅠㅠ 감동적이었음..')
## prediction:  긍정

模型信息

该模型卡暂无预览图和文字说明。以下信息来自 Hugging Face。

作者 cateto
类型text-classification
基础模型—
标签—
下载6
点赞0
更新时间2023-11-02
Hugging Face https://huggingface.co/cateto/gpt-neox-125M-finetuned-nsmc