Analysis started, almost complete - compiled some excel sheets from the csv output with notes. Started infer.py, nothing major implemented yet

This commit is contained in:
2026-03-07 18:51:15 +00:00
parent cabf8aa9b5
commit 5206e62d95
4 changed files with 611 additions and 4 deletions

View File

@@ -51,7 +51,7 @@ class ReviewDataset(Dataset):
if __name__ == "__main__":
dataset = ReviewDataset("data/processed/original_train.csv", AutoTokenizer.from_pretrained("FacebookAI/xlm-roberta-base"))
# print(dataset.__getitem__(1))
print(dataset.__getitem__(1))

View File

@@ -1,4 +1,25 @@
import pandas as pd
import numpy as np
import torch
import argparse
from transformers import AutoTokenizer
from torch.utils.tensorboard import SummaryWriter
# mappings
binary_map = {'Yes': 1, 'No': 0}
aspect_map = {'App': 0, 'Driver': 1, 'General': 2, 'Payment': 3, 'Pricing': 4, 'Service': 5}
sentiment_map = {'Positive': 0, 'Neutral': 1, 'Negative': 2}
binary_map = {1:'Yes', 0:'No'}
aspect_map = {0:'App', 1:'Driver', 2:'General', 3:'Payment', 4:'Pricing', 5:'Service'}
sentiment_map = {0:'Positive', 1:'Neutral', 2:'Negative'}
SEED = 4321
torch.manual_seed(SEED)
np.random.seed(SEED)
def parse_args():
parser = argparse.ArgumentParser(description="RECLASS, Multitask learning for review classification.")
parser.add_argument("--model_path", type=str, help="Enter the models path / the desired .pt file")
parser.add_argument("--task", type=str, default="all", choices=["all", "bug_report", "feature_request", "aspect", "aspect_sentiment"], help="Specific task to train for stl usage only" )
parser.add_argument("--interactive", help="Loops reading input until exit")
parser.add_argument("--text", help="Use command line text for input")
return parser.parse_args()