thuiar / TEXTOIR

TEXTOIR is the first opensource toolkit for text open intent recognition. (ACL 2021)
https://github.com/thuiar/TEXTOIR
MIT License
185 stars 30 forks source link

Inference with ADB #37

Closed liupeiju closed 1 year ago

liupeiju commented 1 year ago

Hello, First thank you for releasing such useful and well-written source! I have used ADB for detection task. However, I find that in file "ADB/manager.py" line #68, "self.model.train()" is used. I am confused about using train() mode instead of eval() mode, since there are no parameters in "self.model" need to be trained. I try to turn it off, and the performance drops drastically. It seems that this setting is on purpose. How should I understand this? Thanks!

MurraryZhao commented 1 year ago

Your question is very valuable and interesting. If model.eval() is used instead of model.train(), then the training features will be exactly the same for each epoch except that the sampling order is different, and the model may overfit. We consider that the boundary learning process is also a training process and requires dropout to improve robustness. We find that if dropout is dropped in the process of learning the boundary, the radius becomes smaller. For example, in the BANKING dataset, the radius will be reduced from 10 to about 5 under the setting of 0.25 known intent ratio. We will continue to explore the effect of features on boundaries in the future.