We are trying to use textcat.teach / active learning for text classification with multiple labels, e.g. wonen (housing), economie, and criminaliteit (crime)
It seems to work and the coding interface is really nice and efficient, but two things are strange:
-
The texts presented do not seem to be very relevant to the label. I’d expect an accept/reject ratio of close to 0.5, but it’s closer to accepting 10% of cases. Also, the texts for one label seem the same as for another label. If I look at db-out they also get the same score/priority regardless of label:
$ ./prodigy db-out topics_train | grep “Wietkwekerij opgerold”
{“text”:“Wietkwekerij opgerold in Kruidenwijk […] “,“meta”:{“id”:188205522,“headline”:“Wietkwekerij opgerold in Kruidenwijk”,“score”:0.0406740457},”_input_hash”:1753281594,"_task_hash":-258418788,“label”:“economie”,“score”:0.0406740457,“priority”:0.0406740457,“spans”:[],“answer”:“reject”}
{“text”:“Wietkwekerij opgerold in Kruidenwijk […]”,“meta”:{“id”:188205522,“headline”:“Wietkwekerij opgerold in Kruidenwijk”,“score”:0.0406740457},"_input_hash":1753281594,"_task_hash":-258418788,“label”:“wonen”,“score”:0.0406740457,“priority”:0.0406740457,“spans”:[],“answer”:“reject”}
{“text”:“Wietkwekerij opgerold in Kruidenwijk […]”,“meta”:{“id”:188205522,“headline”:“Wietkwekerij opgerold in Kruidenwijk”,“score”:0.0406740457},"_input_hash":1753281594,"_task_hash":-258418788,“label”:“economie”,“score”:0.0406740457,“priority”:0.0406740457,“spans”:[],“answer”:“reject”}
{“text”:“Wietkwekerij opgerold in Kruidenwijk […]”,“meta”:{“id”:188205522,“headline”:“Wietkwekerij opgerold in Kruidenwijk”,“score”:0.0406740457},"_input_hash":1753281594,"_task_hash":-258418788,“label”:“criminaliteit”,“score”:0.0406740457,“priority”:0.0406740457,“spans”:[],“answer”:“accept”} -
When I rerun the
textcat.teach
, I would expect to get different examples than in the first session. However, I get the same examples again, even though they are stored in the dataset. See above for the db-out, see below for the screenshot taken after starting a new session after the db-out.
Are we using textcat.teach correctly? Is it possible that our initial model is not trained correctly? It did seem to have around 60% accuracy on a test set (which is not horrible for 12 possible labels)
Thanks again!
– Wouter