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:
@@ -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))
|
||||
|
||||
|
||||
|
||||
|
||||
27
src/infer.py
27
src/infer.py
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user