Update README.md
Browse files
README.md
CHANGED
@@ -5,4 +5,17 @@ metrics:
|
|
5 |
- code_eval
|
6 |
- accuracy
|
7 |
- bertscore
|
8 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
- code_eval
|
6 |
- accuracy
|
7 |
- bertscore
|
8 |
+
---
|
9 |
+
|
10 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
11 |
+
irony_name = "raquiba/sarcasm-detection-BanglaSARC"
|
12 |
+
tokenizer_irony = AutoTokenizer.from_pretrained(irony_name)
|
13 |
+
model_irony = AutoModelForSequenceClassification.from_pretrained(irony_name)
|
14 |
+
irony_pipeline = pipeline("sentiment-analysis", model=model_irony, tokenizer=tokenizer_irony, device=0,max_length=512, padding=True, truncation=True)
|
15 |
+
|
16 |
+
#Model Evaluation
|
17 |
+
tokenizer = AutoTokenizer.from_pretrained(irony_name)
|
18 |
+
df_train, df_test = tokenized_data(df_eval)
|
19 |
+
model_irony = AutoModelForSequenceClassification.from_pretrained(irony_name, num_labels=2, ignore_mismatched_sizes=True).to(device)
|
20 |
+
training_args = TrainingArguments("test-trainer-banglaBERT", {'reprocess_input_data': True}, evaluation_strategy="epoch")
|
21 |
+
trainer_irony.train()
|