Update README.md
Browse files6 unmodified lines789106 unmodified lines- enbase_model:- monologg/koelectra-small-v3-discriminator---6 unmodified lines78910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626 unmodified lines- enbase_model:- monologg/koelectra-small-v3-discriminator---# Is he flirting?Fine-tuned model that check rather someone is flirting with you## Authors- [@DoTaeIn](https://www.github.com/DoTaeIn)## Running TestsTo run tests, run the following command```pythonfrom transformers import AutoTokenizer, AutoModelForSequenceClassification``````pythontokenizer = AutoTokenizer.from_pretrained(path)model = AutoModelForSequenceClassification.from_pretrained(path)model.eval()text = "Input Textdevice = next(model.parameters()).deviceinputs = tokenizer(text,return_tensors="pt",max_length=128,padding="max_length",truncation=True,return_token_type_ids=False)inputs = inputs.to(device)with torch.no_grad():out = model(**inputs)logits = out["logits"]probs = torch.softmax(logits, dim=-1)pred_class = torch.argmax(probs, dim=-1).item()prob_class0 = probs[0, 0].item()prob_class1 = probs[0, 1].item()print("pred:", "Flirting" if pred_class else "Not Flirting")print(f"prob class {pred_class}: {max(prob_class0, prob_class1)}", )```
README.md+53-1