Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inference #2

Open
Moeinh77 opened this issue Jun 27, 2023 · 3 comments
Open

inference #2

Moeinh77 opened this issue Jun 27, 2023 · 3 comments

Comments

@Moeinh77
Copy link

Hi, I have been trying to get your model to work for inference but it has been challenging. I want your model to do few-shot learning on a couple of samples that I provide e.g. with labels L1 and L2. After the few-shot learning, I want to do inference and see if it can predict unseen samples correctly and assign them to L1 and L2. I'd appreciate it if you help me out.

@zhang-yu-wei
Copy link

Hi, thank you very much for your interest to our work!

As far as I understand your question correctly, you want to do binary classification task with few-shot training data.

IntentBERT is pre-trained with source domain data and then we only keep the backbones. We then produce embeddings on few-shot training and testing data with normalization. These normalized embeddings will be used to train classifiers like SVM and logistic regression. Please take a look at this function here: fewShotPredict.

Let me know if this helps!

@Moeinh77
Copy link
Author

Hi, thanks for replying. Yes, I have seen that function, but I was confused about its arguments. In inference time, what should I pass to that function as supportX?

@hdzhang-code
Copy link

Hi, @Moeinh77 ,

SupportX contains the 'few-shot' data, i.e. the few annotated data for classification. For example, it contains 25 data in total, if we have 5 labeled data per class and 5 classes to classify. The data structure SupportX is generated here:
https://github.com/fanolabs/IntentBert/blob/main/utils/Evaluator.py#L67C17-L68C95

As for the details, sorry to say that I also forget. I suggest you set a break point at the aforementioned line and check everything there. To run to that line, you can run the script for evaluation, following the Evaluation part of README.md:
https://github.com/fanolabs/IntentBert/tree/main#evaluation

Best Regards,
Haode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants