absa AspectBasedSentimentAnalysis Classification sentiment

flan-t5-large-absa

This model is a fine-tuned version of google/flan-t5-large on custom dataset prepared by GPT-4 and verified by human.

Model description

Text-to-Text model for aspect based sentiment analysis.

Intended uses & limitations

This is not for commercial use since the dataset was prepared using OpenAI with humans in the loop. It must be tested on the required dataset for accuracy before being released to production.

Training hyperparameters

The following hyperparameters were used during training:

Package Versions

Machine Used and time taken

from transformers import AutoModelForSeq2SeqLM, AutoTokenizer

model = AutoModelForSeq2SeqLM.from_pretrained("shorthillsai/flan-t5-large-absa", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("shorthillsai/flan-t5-large-absa", truncation=True)

prompt = """Find the aspect based sentiment for the given review. 'Not present' if the aspect is absent.\n\nReview:I love the screen of this laptop and the battery life is amazing.\n\nAspect:Battery Life\n\nSentiment: """

input_ids = tokenizer(prompt, return_tensors="pt").to("cuda").input_ids
instruct_model_outputs = instruct_model.generate(input_ids=input_ids)
instruct_model_text_output = tokenizer.decode(instruct_model_outputs[0], skip_special_tokens=True)