I think the method proposed in [1] would be a good addition to the library. [1] https://dl.acm.org/citation.cfm?id=3219819.3219980