简体   繁体   中英

How find the most decisive sentences or words in a document via Doc2Vec?

I've trained a Doc2Vec model in order to do a simple binary classification task, but I would also love to see which words or sentences weigh more in terms of contributing to the meaning of a given text. So far I had no luck finding anything relevant or helpful. Any ideas how could I implement this feature? Should I switch from Doc2Vec to more conventional methods like tf-idf?

You are asking about model interpretability. Some ways I have seen this explored:

  • Depending on your classifier, the parameters of the model may tell you what it is looking at. For example, in attention-based models, what the model attends to is telling.

  • Tools like Lime and Anchor are useful for any black box model, and will probably work in this case. The documentation for both shows how to use it with text data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM