Device could predict preterm birth risk