Giter Site home page Giter Site logo

Code Issue about multi-view-prompting HOT 6 CLOSED

Keep-lucky avatar Keep-lucky commented on July 1, 2024
Code Issue

from multi-view-prompting.

Comments (6)

ZubinGou avatar ZubinGou commented on July 1, 2024 1

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.

from multi-view-prompting.

ZubinGou avatar ZubinGou commented on July 1, 2024 1

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.

from multi-view-prompting.

Keep-lucky avatar Keep-lucky commented on July 1, 2024

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?

from multi-view-prompting.

Keep-lucky avatar Keep-lucky commented on July 1, 2024

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!

from multi-view-prompting.

Keep-lucky avatar Keep-lucky commented on July 1, 2024

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.

for sp in ['great', 'ok', 'bad']:
sp_tokenize_res.extend(self.tokenizer(sp, return_tensors='pt')['input_ids'].tolist()[0])
dic['sentiment_tokens'] = sp_tokenize_res

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!

from multi-view-prompting.

ZubinGou avatar ZubinGou commented on July 1, 2024
  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!

from multi-view-prompting.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.