ntucllab / libact

Pool-based active learning in Python
http://libact.readthedocs.org/
BSD 2-Clause "Simplified" License
777 stars 175 forks source link

libact for NER with probabilistic models #167

Open m-michalek opened 5 years ago

m-michalek commented 5 years ago

Hello guys,

I want to use libact for named entity recognition with a probabilistic model. So from my model, I get a score for each token in a sentence how confident it is with the prediction. Can I use libact for my use case? I could not find a clear answer to my problem from the documentation. I don't know if I have to use a scikit-learn learn model or if libact can be used with any kind of probabilistic models.

From my understanding, a query strategy only needs the predictions or the confidence scores from a model for a specific dataset. So theoretically I should be able to plug your implementation of a query strategy into my model to do Active Learning. Does libact support that?

If yes, does an implementation exist of it? The examples I found, only use scikit-learn models.

Thank you for you help!

yangarbiter commented 5 years ago

You can implement your model by inherit the libact.base.interfaces.ProbabilisticModel and implement its methods.

You can take the example of logistic_regression here:

Then you can pass in your implemented probabilistic model into the query_strategy (active learning algorithm implemented in libact) like other libact models. Let me know if this solves your question.