ZubinGou / multi-view-prompting

Repo for "MvP: Multi-view Prompting Improves Aspect Sentiment Tuple Prediction" [ACL'2023]
MIT License
66 stars 14 forks source link

Code Issue #4

Closed Keep-lucky closed 1 year ago

Keep-lucky commented 1 year ago

I would like to perform fine-tuning training on a custom dataset. Could you please let me know which parameters and files I need to modify? What does the 'const.py' file represent? Do I need to build it based on my custom dataset?

ZubinGou commented 1 year ago

You can modify only the data and configure the data path. You may want to calculate the optimized orders with this code and put the orders in const.py.

  1. If it is different from any dataset in our code base, you need to build a new category list (such as rest_cate_list) and calculate the optimal orders of elements required in your custom dataset (such as [O][A][C][S]) via the function choose_best_order_global, then update the dict optim_orders_all.

  2. You need to update the file 'force_tokens.json' for constrained decoding. Refer to prefix_allowed_tokens_fn. Note that you should first modify the category list of your dataset before doing this.

Keep-lucky commented 1 year ago

You can modify only the data and configure the data path. You may want to calculate the optimized orders with this code and put the orders in const.py.

  1. If it is different from any dataset in our code base, you need to build a new category list (such as rest_cate_list) and calculate the optimal orders of elements required in your custom dataset (such as [O][A][C][S]) via the function choose_best_order_global, then update the dict optim_orders_all.
  2. You need to update the file 'force_tokens.json' for constrained decoding. Refer to prefix_allowed_tokens_fn. Note that you should first modify the category list of your dataset before doing this.

Thank you very much for your previous response. I still have a question regarding the construction of a new category list for a custom dataset. I've looked at the category lists in the code, and I'm wondering if these lists are built based on the categories to which the aspect terms belong. Additionally, the aspect terms in my custom dataset cover multiple domains. Should the category list I construct aim to encompass the domains to which the aspect terms belong as much as possible?

ZubinGou commented 1 year ago

The categories to which the aspect terms belong depend on your dataset. You only need to build the category list if you want to use constrained decoding, which is optional.

Keep-lucky commented 1 year ago

The categories to which the aspect terms belong depend on your dataset. You only need to build the category list if you want to use constrained decoding, which is optional.

Thank you very much for your response. I wish you success in your work and a delightful life!

Keep-lucky commented 1 year ago

1.Following your advice, I have been using constrained decoding on a custom dataset. While constructing the 'force_tokens.json' file, I noticed that the prefix_allowed_tokens_fn function may require some additional information. Upon comparing it with the original code in 'force_tokens.json', I believe it would be appropriate to make the following modifications by adding a dictionary for each task name. https://github.com/ZubinGou/multi-view-prompting/blob/d91f3ec49d09a31ec5eada8c98b3a2c53b54f23e/src/main.py#L343-L345 556b170b92a93b87569557da2749412 image

2.Additionally, I have encountered some issues during the decoding process in inference. Specifically, when decoding sentences consisting of only two words, such as "Great price." the output is limited to [O] great [A] price, omitting the sentiment [S] positive tags. I was wondering if you came across a similar problem during your experimentation. Could this issue be related to my utilization of constrained decoding or the [O] [A] [S] element order prompts?

I am eagerly awaiting your response!

ZubinGou commented 1 year ago
  1. Thank you very much for your correction. We overlooked this part while cleaning the code, and it has now been fixed.

  2. We haven't encountered this issue before. Perhaps you can check your data format.

Best regards!