Closed Ibrokhimsadikov closed 1 year ago
This model is only tested and available for pyabsa, not for huggingface. To train your own model, you can try to annotate your own dataset and use the training script in https://github.com/yangheng95/PyABSA/tree/v2/examples-v2/aspect_opinion_sentiment_category_extraction, ie., multitask_train.py
Thank you so much @yangheng95 for prompt response.
If I want to annotate my own dataset, it should look like that:
{"text": "keyboard and mouse pad seem fine , but overall it seems strangely slow .", "labels": [{"aspect": "keyboard", "opinion": "fine", "polarity": "positive", "category": "KEYBOARD#DESIGN_FEATURES"}, {"aspect": "mouse pad", "opinion": "fine", "polarity": "positive", "category": "KEYBOARD#DESIGN_FEATURES"}, {"aspect": "NULL", "opinion": "slow", "polarity": "negative", "category": "LAPTOP#GENERAL"}]}
If not, can you please provide one example snapshot how training data should look like?
Much appreciate your support on that
Thank you so much @yangheng95 for prompt response.
If I want to annotate my own dataset, it should look like that:
{"text": "keyboard and mouse pad seem fine , but overall it seems strangely slow .", "labels": [{"aspect": "keyboard", "opinion": "fine", "polarity": "positive", "category": "KEYBOARD#DESIGN_FEATURES"}, {"aspect": "mouse pad", "opinion": "fine", "polarity": "positive", "category": "KEYBOARD#DESIGN_FEATURES"}, {"aspect": "NULL", "opinion": "slow", "polarity": "negative", "category": "LAPTOP#GENERAL"}]}
If not, can you please provide one example snapshot how training data should look like?
Much appreciate your support on that
Yes
@yangheng95 Hi, thanks a lot for your work. Can you provide also for me a snapshot of the data in order to fine-tune the Quadruple model?? I'm very interesting on that.
@lorisdiquilio Please refer to: https://github.com/yangheng95/PyABSA/blob/v2/examples-v2/aspect_opinion_sentiment_category_extraction/multitask_train.py
@yangheng95 Ok, thanks a lot. Once I trained the model with this structure mentioned: {"text": "keyboard and mouse pad seem fine , but overall it seems strangely slow .", "labels": [{"aspect": "keyboard", "opinion": "fine", "polarity": "positive", "category": "KEYBOARD#DESIGN_FEATURES"}, {"aspect": "mouse pad", "opinion": "fine", "polarity": "positive", "category": "KEYBOARD#DESIGN_FEATURES"}, {"aspect": "NULL", "opinion": "slow", "polarity": "negative", "category": "LAPTOP#GENERAL"}]}
how can i predict on the new sentences?
You can refer to the example: https://github.com/yangheng95/PyABSA/blob/v2/examples-v2/aspect_opinion_sentiment_category_extraction/inference.py
I was able to train the model thanks to @yangheng95 guide! Thanks
@yangheng95, first of all thank you for your amazing work.
Inspired from your work I want to train Quadruple model:
1)How input data looks like in training stage? Is this below correct?
{"text": "keyboard and mouse pad seem fine , but overall it seems strangely slow .", "labels": [{"aspect": "keyboard", "opinion": "fine", "polarity": "positive", "category": "KEYBOARD#DESIGN_FEATURES"}, {"aspect": "mouse pad", "opinion": "fine", "polarity": "positive", "category": "KEYBOARD#DESIGN_FEATURES"}, {"aspect": "NULL", "opinion": "slow", "polarity": "negative", "category": "LAPTOP#GENERAL"}]}
2) How train this model in Hugging face way, as I saw couple of spaces as examples here, is it possible to fine tune them: https://huggingface.co/spaces/yangheng/PyABSA
Should I follow here to train the model: https://github.com/yangheng95/PyABSA/tree/v2/examples-v2/aspect_opinion_sentiment_category_extraction
rely on your support and guidance!