Views
No views yet
1nlp = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
2
3nlp("The results don't match, but the effort seems to be always high")
4
5Out[7]: [{'label': 'Positive', 'score': 0.9996090531349182}]
X_train, X_val, y_train, y_val = train_test_split(X,y, test_size = 0.2, stratify = y)
'input_ids': tensor
'attention_mask': tensor
'label': tensor(2)args = TrainingArguments(
output_dir="output",
do_train = True,
do_eval = True,
num_train_epochs = 1,
per_device_train_batch_size = 4,
per_device_eval_batch_size = 8,
warmup_steps = 50,
weight_decay = 0.01,
logging_strategy= "steps",
logging_dir= "logging",
logging_steps = 50,
eval_steps = 50,
save_strategy = "steps",
fp16 = True,
#load_best_model_at_end = True
)global_step=879,
training_loss=0.1825900522650848,'train_runtime': 101.6309,
'train_samples_per_second': 34.596,
'train_steps_per_second': 8.649,
'total_flos': 346915041274368.0,
'train_loss': 0.1825900522650848,
'epoch': 1.0# Assuming you have a list of evaluation results q and want to create a DataFrame with it
q = [Trainer.evaluate(eval_dataset=df) for df in [train_dataset, val_dataset]]
# Create DataFrame with index and select only the first 5 columns
result_df = pd.DataFrame(q, index=["train", "val"]).iloc[:,:5]
# Display the resulting DataFrame
print(result_df)
______________________________________________________________________
eval_loss eval_Accuracy eval_F1 eval_Precision eval_Recall
train 0.049349 0.988908 0.987063 0.982160 0.992357
val 0.108378 0.976136 0.972464 0.965982 0.979861
______________________________________________________________________@inproceedings{camacho-collados-etal-2022-tweetnlp,
title = "{T}weet{NLP}: Cutting-Edge Natural Language Processing for Social Media",
author = "Camacho-collados, Jose and
Rezaee, Kiamehr and
Riahi, Talayeh and
Ushio, Asahi and
Loureiro, Daniel and
Antypas, Dimosthenis and
Boisson, Joanne and
Espinosa Anke, Luis and
Liu, Fangyu and
Mart{\'\i}nez C{\'a}mara, Eugenio" and others,
booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing: System Demonstrations",
month = dec,
year = "2022",
address = "Abu Dhabi, UAE",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2022.emnlp-demos.5",
pages = "38--49"
}